Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations sizbut on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Next working day script

Status
Not open for further replies.

Sontec

IS-IT--Management
May 20, 2002
12
GB
Hi all,

I'm hoping that someone out there can help me with something thats got me stumped within an Excel macro.

We have a requirement to pull certain information from a spreadsheet when the delivery date field is the next working day. (i.e. if we run the macro on a Friay, we need to pull out Mondays deliveries)

Is there an easy way of making excel ignore weekends?

Thanks.
 
You can use the Weekday function to determine what day of the week it is:

tDay = datevalue(today())
nDay = tDay + 1
Select Case nDay
Case is 1 or 7
'Weekend
Case Else
'not Weekend
end select Rgds
Geoff

Vah! Denuone Latine loquebar? Me ineptum. Interdum modo elabitur
 
Check out the WorkDay function. The info below is direct from Excel help:
Returns a number that represents a date that is the indicated number of working days before or after start_date. Working days exclude weekends and any dates identified as holidays. Use WORKDAY to exclude weekends or holidays when you calculate invoice due dates, expected delivery times, or the number of days of work performed. To view the number as a date, click Cells on the Format menu, click Date in the Category box, and then click a date format in the Type box.
Do a search for WorkDay function in Excel Help for more info...
Hope this helps,
sdraper
 
Oooops... I think I misunderstood your question. Workday may not work for what you want. Sorry!
sdraper
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top