Change it to this...
If Weekday(Now(), 2) > 4 Then
inc = 8 - Weekday(Now(), 2)
Else
inc = 1
End If
ActiveWorkbook.SaveAs ("C:\My Documents\" & Format((Now() + inc), "mm""-""dd""-""yyyy") & " Sales.xls")
Rob
Thanks Rob, one follow up
Thanks Rob, I'll experiment to add that third argument regarding the date table showing company holidays, but this definitely pointed me in the right direction.
Thanks again.
Tom
Re: Thanks Rob, one follow up
Sorry Chief, try this one...
If Weekday(Now(), 2) > 4 Then
inc = 8 - Weekday(Now(), 2)
Else
inc = 1
End If
for Hol = 1 to 10
if range("Sheet!A" & Hol).value = (Now()+inc) then
inc=inc+1
If Weekday((Now()+inc), 2) > 4 Then
inc = inc +(8 - Weekday(Now(), 2))
end if
end if
next Hol
ActiveWorkbook.SaveAs ("C:\My Documents\" & Format((Now() + inc), "mm""-""dd""-""yyyy") & " Sales.xls")
If the dates are in "A" column of worksheet "Sheet" in cells 1 to 10 in increasing size (future at 10 past at 1) then this should even pick up consecutive holiday dates)
Hope it helps.
Rob Thanks Rob, I'll experiment to add that third argument regarding the date table showing company holidays, but this definitely pointed me in the right direction. Thanks again. Tom : Change it to this... : If Weekday(Now(), 2) > 4 Then
Yo Rob, still not right but I'll try to adjust
Hey Rob, thanks again, except that this doesn't seem to take into consideration files Saved As on a Friday before a 3-day weekend, such as Labor Day weekend; I keep getting the new saved as date being that holiday Monday even with my dates in ascending order in A1:A10 of Sheet2 (not "Sheet" but Sheet2 which I adjusted from your code). I'll keep trying unless you see something in your code that jumps out as not right. Thanks again.
Chief Sorry Chief, try this one...
In B1 enter: =TODAY()
In B2 enter: =IF(OR(WEEKDAY(B1)={1,7},ISNUMBER(MATCH(B1,A1:A10,0))),WORKDAY(B1,1,A1:A10),B1)
Incorporate B2 (by concatenating) the filename that you built within your macro.
Aladin
==============