Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I want to rename my worksheet tabs to be numbered: Jan-09, Feb-09,
Mar-09...Nov-10, Dec-10 I would like to start the numbering at the second Tab (The first Tab is "Summary". Can I place a line of code to perform this? I am modifying 20 workbooks, so after re-typing the tabs on a couple it seems there might be an easier way. |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Darrell
Try the below macro Sub CreateMonthSheets() Dim intTemp Dim dtTemp As Date dtTemp = "1/Jan/2009" ActiveWorkbook.Sheets.Add Count:=(25 - ActiveWorkbook.Sheets.Count) For intTemp = 2 To ActiveWorkbook.Sheets.Count ActiveWorkbook.Sheets(intTemp).Name = _ Format(DateAdd("m", (intTemp - 2), dtTemp), "mmm-yy") Next End Sub If this post helps click Yes --------------- Jacob Skaria "Dr. Darrell" wrote: I want to rename my worksheet tabs to be numbered: Jan-09, Feb-09, Mar-09...Nov-10, Dec-10 I would like to start the numbering at the second Tab (The first Tab is "Summary". Can I place a line of code to perform this? I am modifying 20 workbooks, so after re-typing the tabs on a couple it seems there might be an easier way. |
#3
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Forgot to mention that the macro will insert 24 sheets and name from Jan-09
to Dec-10. If you are new to macros set the Security level to low/medium in (Tools|Macro|Security). From workbook launch VBE using short-key Alt+F11. From menu 'Insert' a module and paste the below code. Save. Get back to Workbook. Run macro from Tools|Macro|Run <selected macro() If this post helps click Yes --------------- Jacob Skaria "Jacob Skaria" wrote: Darrell Try the below macro Sub CreateMonthSheets() Dim intTemp Dim dtTemp As Date dtTemp = "1/Jan/2009" ActiveWorkbook.Sheets.Add Count:=(25 - ActiveWorkbook.Sheets.Count) For intTemp = 2 To ActiveWorkbook.Sheets.Count ActiveWorkbook.Sheets(intTemp).Name = _ Format(DateAdd("m", (intTemp - 2), dtTemp), "mmm-yy") Next End Sub If this post helps click Yes --------------- Jacob Skaria "Dr. Darrell" wrote: I want to rename my worksheet tabs to be numbered: Jan-09, Feb-09, Mar-09...Nov-10, Dec-10 I would like to start the numbering at the second Tab (The first Tab is "Summary". Can I place a line of code to perform this? I am modifying 20 workbooks, so after re-typing the tabs on a couple it seems there might be an easier way. |
#4
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Jacob:
I have quite a few functions in the worksheets which are linked to several workbooks, so I would prefer to rename the existing tabs if possible. "Dr. Darrell" wrote: I want to rename my worksheet tabs to be numbered: Jan-09, Feb-09, Mar-09...Nov-10, Dec-10 I would like to start the numbering at the second Tab (The first Tab is "Summary". Can I place a line of code to perform this? I am modifying 20 workbooks, so after re-typing the tabs on a couple it seems there might be an easier way. |
#5
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Try the below
Sub CreateMonthSheets() Dim intTemp Dim dtTemp As Date dtTemp = "1/Jan/2009" For intTemp = 2 To ActiveWorkbook.Sheets.Count ActiveWorkbook.Sheets(intTemp).Name = _ Format(DateAdd("m", (intTemp - 2), dtTemp), "mmm-yy") Next End Sub If this post helps click Yes --------------- Jacob Skaria "Dr. Darrell" wrote: Jacob: I have quite a few functions in the worksheets which are linked to several workbooks, so I would prefer to rename the existing tabs if possible. "Dr. Darrell" wrote: I want to rename my worksheet tabs to be numbered: Jan-09, Feb-09, Mar-09...Nov-10, Dec-10 I would like to start the numbering at the second Tab (The first Tab is "Summary". Can I place a line of code to perform this? I am modifying 20 workbooks, so after re-typing the tabs on a couple it seems there might be an easier way. |
#6
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Thank You; this seems to do the trick.
"Jacob Skaria" wrote: Try the below Sub CreateMonthSheets() Dim intTemp Dim dtTemp As Date dtTemp = "1/Jan/2009" For intTemp = 2 To ActiveWorkbook.Sheets.Count ActiveWorkbook.Sheets(intTemp).Name = _ Format(DateAdd("m", (intTemp - 2), dtTemp), "mmm-yy") Next End Sub If this post helps click Yes --------------- Jacob Skaria "Dr. Darrell" wrote: Jacob: I have quite a few functions in the worksheets which are linked to several workbooks, so I would prefer to rename the existing tabs if possible. "Dr. Darrell" wrote: I want to rename my worksheet tabs to be numbered: Jan-09, Feb-09, Mar-09...Nov-10, Dec-10 I would like to start the numbering at the second Tab (The first Tab is "Summary". Can I place a line of code to perform this? I am modifying 20 workbooks, so after re-typing the tabs on a couple it seems there might be an easier way. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
rename excel tabs months for year without doing it individually | Excel Worksheet Functions | |||
rename sheet tabs in excel | Excel Discussion (Misc queries) | |||
rename tabs | Excel Discussion (Misc queries) | |||
Rename all existing worksheet tabs | Excel Discussion (Misc queries) | |||
RENAME SHEET TABS AOYUMATICALLY | Excel Discussion (Misc queries) |