ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   naming tabs (https://www.excelbanter.com/excel-worksheet-functions/168121-naming-tabs.html)

Steve

naming tabs
 
Hello
I would like to use a macro to name the sheets in a workbook.
I want the tabs to be named Jan & year through Dec & year.
I know I don't have to ask if it is possible, you people are great thanks in
advance for the help.

--
Thank You
Steve

Gary''s Student

naming tabs
 
Sub missive()
s = Array("jan", "feb", "mar", "apr", "may", "jun", "jul", "aug", "sep",
"oct", "nov", "dec")
For i = 1 To 12
Sheets(i).Name = s(i - 1) & " 2008"
Next
End Sub

mind the text wrapping!!
--
Gary''s Student - gsnu200759

Don Guillett

naming tabs
 
Sub namesheets()
With Sheet1
my = Year(Date)
mm = 0
End With

For i = 1 To 12
Sheets.Add After:=Sheets(Sheets.Count)
With ActiveSheet
.Name = Format(DateSerial(my, mm + i, 1), "mmm yy")
End With
Next i
End Sub

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"steve" wrote in message
...
Hello
I would like to use a macro to name the sheets in a workbook.
I want the tabs to be named Jan & year through Dec & year.
I know I don't have to ask if it is possible, you people are great thanks
in
advance for the help.

--
Thank You
Steve




All times are GMT +1. The time now is 05:10 PM.

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