Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default copy sheets

I have the following macro that names the tabs in a workbook by the month and
year.. how do I get the contents of sheet1 to copy with this.. rather than
all of them being blank... also I still want the months on the tabs to be dec
to jan left to right rather than Jan to dec left to right..
ideas?


Sub createmonthsheets()
Dim intTemp
Dim dtTemp As Date
dtTemp = "Jan 2010"
ActiveWorkbook.Sheets.Add Count:=(14 - 1 - ActiveWorkbook.Sheets.Count)
For intTemp = 2 To ActiveWorkbook.Sheets.Count
ActiveWorkbook.Sheets(intTemp).Name = _
Format(DateAdd("m", (intTemp - 2), dtTemp), "mmm-yy")
Next
ActiveWorkbook.Save
End Sub

 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
move or copy sheets doesn't copy format ColinX Excel Worksheet Functions 1 May 14th 08 10:07 PM
copy sheets Pammy Excel Discussion (Misc queries) 3 February 22nd 08 08:49 PM
copy many sheets into one Annie_Ioceva Excel Worksheet Functions 1 January 9th 08 04:14 PM
Copy Sheets griify Excel Discussion (Misc queries) 2 December 9th 05 11:21 PM
in VBA Sheets("mysheet").Copy Befo=Sheets(1) how do i get a reference to the newly created copy of this sheet? Daniel Excel Worksheet Functions 1 July 6th 05 09:57 PM


All times are GMT +1. The time now is 08:59 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"