Home |
Search |
Today's Posts |
#15
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
This might take you forward
Const sFile As String = "gAMS_Report_" Dim sFilename As String Dim sThis As Workbook Dim sLast As Workbook Dim ThisMonth As String ThisMonth = "Oct" sFilename = sFile & Format(DateValue("01-" & ThisMonth & "-" & Year(Date)), "mmm_yy") Set oWBThis = Workbooks.Open(sFile) sFilename = sFile & Format(DateValue("01-" & ThisMonth & "-" & Year(Date)) - 1, "mmm_yy") Set oWBLast = Workbooks.Open(sFile) -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Les" wrote in message ups.com... Hi Bob, I have the month in format mmm. The variable is actually "ThisMonth" regards, Les Bob Phillips wrote: As I said, what is in that variable Month? -- HTH Bob Phillips (replace somewhere in email address with gmail if mailing direct) "Les Stout" wrote in message ... Hi Bob, I am sure your code will work, sorry as said before i am not a programmer and did not understand the <Date. I however do get an error as per my last thread. best regards, Les Stout *** Sent via Developersdex http://www.developersdex.com *** |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to print select months from worksheet | Excel Discussion (Misc queries) | |||
How do I select 13 months from a data range for charts | Charts and Charting in Excel | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming | |||
Prompt user to select file with default file selected dialog | Excel Programming |