|
-
Nov 9th, 2000, 11:12 AM
#1
Thread Starter
PowerPoster
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.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Nov 9th, 2000, 11:31 AM
#2
Take a look at this thread.
-
Nov 9th, 2000, 11:38 AM
#3
Fanatic Member
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
-
Nov 9th, 2000, 11:40 AM
#4
Frenzied Member
Matthew,
Well, you lost me ~¿ô
Take a look at this thread = how i can print a picture(jpg,bmp) to printer?
-
Nov 9th, 2000, 11:46 AM
#5
Fanatic Member
Of course, my code takes into account that you want to include the Min and Max date in the calculation...
-
Nov 9th, 2000, 11:49 AM
#6
Thread Starter
PowerPoster
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.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Nov 9th, 2000, 11:55 AM
#7
Fanatic Member
Pleasure, was bored anyway. Doing crappy spreadsheet work at the mo…
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|