ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Create new sheet with a macro (https://www.excelbanter.com/excel-programming/399651-create-new-sheet-macro.html)

Jock

Create new sheet with a macro
 
I have a sheet named "Sep 07".
How can I create a new sheet, automatically named "Oct 07", and copy
formatting (but not data) as well as vba code and buttons from "Sep 07"
(Range A1:M25) by using a macro?
Obviously, at the end of October, the new sheet will need to be called "Nov
07" and so on. How would I deal with that?
Thanks,
--
Traa Dy Liooar

Jock

Bernard Liengme

Create new sheet with a macro
 
Do you need a macro?
Follow these steps (use a test workbook)
1 Click the tab for Sep 07
2 Hold CTRL
3 Drag the tab to the right; this makes a worksheet named Sept 07 (2)
4 On the new sheet, click the top left corner where column and row heading
meet (or use CTRL+ A maybe twice) to select the whole worksheet. Now use
Delete key. All cell entries go but formats and text boxes etc remain.
5 Rename the sheet to taste
--
Bernard V Liengme
Microsoft Excel MVP
www.stfx.ca/people/bliengme
remove caps from email

"Jock" wrote in message
...
I have a sheet named "Sep 07".
How can I create a new sheet, automatically named "Oct 07", and copy
formatting (but not data) as well as vba code and buttons from "Sep 07"
(Range A1:M25) by using a macro?
Obviously, at the end of October, the new sheet will need to be called
"Nov
07" and so on. How would I deal with that?
Thanks,
--
Traa Dy Liooar

Jock





All times are GMT +1. The time now is 04:20 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com