ravikumar00008
New member
- Joined
- Jun 13, 2012
- Messages
- 20
- Reaction score
- 0
- Points
- 0
Hi All,
if the workbook sheet names are like this "Jan '12"....."Jun '12","Jul '12"..etc (All are in the same format)
I am using this code to find out the current month and previous month sheets in my workbook
If the workbook sheet names are like this "Jan '12","Feb '12","Mar '12","April '12","May '12","June '12","Jul '12","Aug '12","Sept '12","Oct '12","Nov '12",
"Dec '12"
see these are not in the same format.
Now how to find the current month and previous month sheets from this kind of workbook.
Thanks in advance.
Regards
Kumar
if the workbook sheet names are like this "Jan '12"....."Jun '12","Jul '12"..etc (All are in the same format)
I am using this code to find out the current month and previous month sheets in my workbook
Code:
sub test()Dim CurrMonth As String, PrevMonth As String
CurrMonth = Format$(Date, "mmm 'yy")
PrevMonth = Format$(Date - Day(Date), "mmm 'yy")
sheets(CurrMonth).select
msgbox "current month",,currmonth
sheets(prevmonth).select
msgbox "previous month",,prevmonth
end sub
"Dec '12"
see these are not in the same format.
Now how to find the current month and previous month sheets from this kind of workbook.
Thanks in advance.
Regards
Kumar
Last edited: