-
Like you've got nothing better to do:
My situation:
Knowing a MIN DATE and a MAX DATE, how can you display all SATURDAY dates that fall between these two dates in say, a combo box? I am trying to make user pick a valid SATURDAY date.
Any suggestions. I know I could evaluate the date to detremine it's a Saturday, but I figured the way I described might be easier for the user.
-
Take a look at this thread.
-
You're right, this is the most interesting code I've written today.
So:
Code:
Sub Saturdays()
Dim dteMin As Date, dteMax As Date
Dim iDay As Integer, iCount As Integer
dteMin = #1/1/90#
dteMax = #1/1/10#
Do Until dteMin = dteMax
iDay = WeekDay(dteMin)
If iDay = 7 Then 'i.e. Saturday
iCount = iCount + 1
End If
dteMin = dteMin + 1
Loop
MsgBox iCount & " Saturdays"
End Sub
-
Matthew,
Well, you lost me ~¿ô
Take a look at this thread = how i can print a picture(jpg,bmp) to printer?
-
Of course, my code takes into account that you want to include the Min and Max date in the calculation...
-
Gaffer
Thanks.
After reading your reply, it's obviuos. Thanks for your help. Also, yes I was looking to include the MIN and MAX date in the calculation (Reading my mind).
Thanks again.
-
Pleasure, was bored anyway. Doing crappy spreadsheet work at the mo…