Click here to Skip to main content
15,922,427 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Capture the key hit Pin
7-Jul-01 20:41
suss7-Jul-01 20:41 
GeneralOutlook VB script: Print Method Pin
15-Jun-01 5:21
suss15-Jun-01 5:21 
GeneralActiveX control for the web Pin
15-Jun-01 4:45
suss15-Jun-01 4:45 
GeneralDates and period in between (Excel VBA) Pin
Ian14-Jun-01 23:17
Ian14-Jun-01 23:17 
GeneralRe: Dates and period in between (Excel VBA) Pin
Ian15-Jun-01 5:07
Ian15-Jun-01 5:07 
GeneralRe: Dates and period in between (Excel VBA) Pin
AndyG15-Jun-01 11:05
AndyG15-Jun-01 11:05 
GeneralRe: Dates and period in between (Excel VBA) Pin
Ian15-Jun-01 21:29
Ian15-Jun-01 21:29 
GeneralRe: Dates and period in between (Excel VBA) Pin
Ian17-Jun-01 22:34
Ian17-Jun-01 22:34 
This works but I am open to simpler suggestions

Dim TheDate As Date ' Declare variables.
Dim Msg
Dim hey
Dim Ms
Dim instal
Dim instmon
Dim mon


TheDate = Date
Msg = DatePart("m", TheDate) ' Msg now equals the number current month number


dayDate = Date
Ms = DatePart("d", dayDate) 'Ms now equals the current day number

If Ms >= 8 Then

Msg = Msg + 1
End If
instal = 15 & "th "

If Msg = 1 Then
mon = "January"
End If

If Msg = 2 Then
mon = "February"
End If

If Msg = 3 Then
mon = "March"
End If

If Msg = 4 Then
mon = "April"
End If

If Msg = 5 Then
mon = "May"
End If

If Msg = 6 Then
mon = "June"
End If

If Msg = 7 Then
mon = "July"
End If

If Msg = 8 Then
mon = "August"
End If

If Msg = 9 Then
mon = "September"
End If

If Msg = 10 Then
mon = "October"
End If

If Msg = 11 Then
mon = "November"
End If

If Msg = 12 Then
mon = "December"
End If

ActiveSheet.Cells(87, 3).Value = instal & mon
ActiveSheet.Cells(87, 4).Value = "monthly"
ActiveSheet.Cells(88, 3).Value = "15-03-02"


Else
If freq = "weekly" Then
ActiveSheet.Cells(31, 2).Value = (ActiveSheet.Cells(29, 8).Value) / (fred + 1)
ActiveSheet.Cells(31, 1).Value = (("Less " & fred + 1) & " payments @")
ActiveSheet.Cells(31, 8).Value = (ActiveSheet.Cells(31, 2).Value) * (fred + 1)

Dim i As Integer
Dim datTemp As Date

For i = 1 To 7
datTemp = DateAdd("d", i, Date)
If Weekday(datTemp) = vbMonday Then

ActiveSheet.Cells(87, 3).Value = datTemp
ActiveSheet.Cells(87, 4).Value = "weekly"
ActiveSheet.Cells(88, 3).Value = "25-03-02"

'MsgBox "Next Monday will be " & datTemp
End If
Next
Generalplease help Pin
Rodney14-Jun-01 20:39
Rodney14-Jun-01 20:39 
Generalinput validation Pin
Ian11-Jun-01 2:37
Ian11-Jun-01 2:37 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 3:09
Michael P Butler11-Jun-01 3:09 
GeneralRe: input validation Pin
Ian11-Jun-01 4:16
Ian11-Jun-01 4:16 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 5:00
Michael P Butler11-Jun-01 5:00 
GeneralRe: input validation Pin
Ian11-Jun-01 5:36
Ian11-Jun-01 5:36 
GeneralRe: input validation Pin
Ian11-Jun-01 5:59
Ian11-Jun-01 5:59 
GeneralRe: input validation Pin
Michael P Butler11-Jun-01 8:48
Michael P Butler11-Jun-01 8:48 
GeneralRe: input validation Pin
Ian11-Jun-01 20:31
Ian11-Jun-01 20:31 
GeneralMicrosoft Outlook 2000 Pin
Mahesh Sundararaman10-Jun-01 23:49
Mahesh Sundararaman10-Jun-01 23:49 
Generalexcel vba Pin
Ian10-Jun-01 8:36
Ian10-Jun-01 8:36 
GeneralRe: excel vba Pin
Giles10-Jun-01 8:51
Giles10-Jun-01 8:51 
GeneralRe: excel vba Pin
Ian10-Jun-01 20:13
Ian10-Jun-01 20:13 
GeneralRe: excel vba Pin
Giles12-Jun-01 9:10
Giles12-Jun-01 9:10 
GeneralRe: excel vba Pin
Ian14-Jun-01 4:31
Ian14-Jun-01 4:31 
GeneralRe: excel vba Pin
Giles14-Jun-01 8:54
Giles14-Jun-01 8:54 
GeneralTextBox Question Pin
6-Jun-01 22:15
suss6-Jun-01 22:15 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.