Malek
11-05-2007, 09:28 AM
I have a set of dates in excel that I need to be able to loop through however the starting dates are not always on the first and so I need to be able to determine the day but not the year or month. What I have is not working
checkDates (ActiveCell.Value)
Please note that there is a difference in the case statements simply because I am trying to get the first one to work and then I will modify the rest based off of that one.
Sub checkDates(day As String)
Dim mth As String
Dim dy As String
Dim yr As String
'MsgBox day
Select Case day
Case1 "/1/" Like "*" & day & "*":
MsgBox "day one"
Case day Like "*/2/*"
Case day Like "*/3/*":
Case day Like "*/4/*":
Case day Like "*/5/*":
Case day Like "*/6/*":
Case day Like "*/7/*":
Case Else
MsgBox "test"
End Select
Thank you
checkDates (ActiveCell.Value)
Please note that there is a difference in the case statements simply because I am trying to get the first one to work and then I will modify the rest based off of that one.
Sub checkDates(day As String)
Dim mth As String
Dim dy As String
Dim yr As String
'MsgBox day
Select Case day
Case1 "/1/" Like "*" & day & "*":
MsgBox "day one"
Case day Like "*/2/*"
Case day Like "*/3/*":
Case day Like "*/4/*":
Case day Like "*/5/*":
Case day Like "*/6/*":
Case day Like "*/7/*":
Case Else
MsgBox "test"
End Select
Thank you