Thread: Month plus one
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
martin martin is offline
external usenet poster
 
Posts: 11
Default Month plus one

Dim PathName as String
Dim NewDate as Date

PathName = "G:\CC folder\Accounts\grape juice\LA Sheets\Concord "
NewDate = DateSerial(Year(Date),Month(Date)+1,1)
' NewDate is the first of next month; otherwise if we put 'Day(Date)'
instead of '1'
' then the code would blow up on January 30, March 31, etc.
PathName = PathName & Format(NewDate, "mmmm") & ".xls"