ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   rename sheet tabs in excel (https://www.excelbanter.com/excel-discussion-misc-queries/155313-rename-sheet-tabs-excel.html)

blantyreson

rename sheet tabs in excel
 
I have a workboo that contains 13 worksheets, I want to rename all sheets
beginning with Mar 07, April 07 etc. I have forgotten how to do this without
renaming individually. Can anyone help? Thanks

Dave Peterson

rename sheet tabs in excel
 
You could use a macro:

Option Explicit
Sub testme()
Dim wCtr As Long
For wCtr = 1 To Worksheets.Count
Worksheets(wCtr).Name = Format(DateSerial(2007, wCtr + 2, 1), "mmmm-yy")
Next wCtr
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

blantyreson wrote:

I have a workboo that contains 13 worksheets, I want to rename all sheets
beginning with Mar 07, April 07 etc. I have forgotten how to do this without
renaming individually. Can anyone help? Thanks


--

Dave Peterson

David McRitchie

rename sheet tabs in excel
 
Minor change I would suggest that when naming worksheets or files
that are based on a date that you put the year before the month and
day so that they can be sorted or appear in a directory in order.
"yyyy-mm" instead of "mmmm-yy"

A macro to sort worksheets by their name SortALLSheets in
http://www.mvps.org/dmcritchie/excel...#sortallsheets
--
HTH,
David McRitchie, Microsoft MVP -- Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm


"Dave Peterson" wrote in message
...
You could use a macro:

Option Explicit
Sub testme()
Dim wCtr As Long
For wCtr = 1 To Worksheets.Count
Worksheets(wCtr).Name = Format(DateSerial(2007, wCtr + 2, 1),
"mmmm-yy")
Next wCtr
End Sub

If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

blantyreson wrote:

I have a workboo that contains 13 worksheets, I want to rename all sheets
beginning with Mar 07, April 07 etc. I have forgotten how to do this
without
renaming individually. Can anyone help? Thanks


--

Dave Peterson




All times are GMT +1. The time now is 05:55 AM.

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