ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   Excel 2002 : Can I speed fill tabs ? (https://www.excelbanter.com/excel-discussion-misc-queries/157825-excel-2002-can-i-speed-fill-tabs.html)

Mr. Low

Excel 2002 : Can I speed fill tabs ?
 
Dear Sir,

My I know if I can speed fill the name of each worksheet (tab) in certain
sequence such as :

1 Jan-07, Feb07, Mar-07....
2. 1997, 1998, 1999, 2000 ...
2. Sun, Mon Tue, Wed ...
3 1/6, 2/6, 3/6.....
4 XP1, XP2, XP3 ...

I find that it is very time consuming and tedious to rename large number of
pages.

Thanks

Low



--
A36B58K641

Dave Peterson

Excel 2002 : Can I speed fill tabs ?
 
You can use macros to do this kind of work--except for #3. You can't use
slashes in worksheet names.

#1.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = Format(DateSerial(2007, iCtr, 1), "mmm-yy")
Next wks

#2.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 1996
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = iCtr
Next wks

#2. (with 7 or less worksheets):
Dim iCtr As Long
For iCtr = 1 To 7
Worksheets(iCtr).Name = Format(iCtr, "ddd")
Next iCtr

#4.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = "XP" & iCtr
Next wks




Mr. Low wrote:

Dear Sir,

My I know if I can speed fill the name of each worksheet (tab) in certain
sequence such as :

1 Jan-07, Feb07, Mar-07....
2. 1997, 1998, 1999, 2000 ...
2. Sun, Mon Tue, Wed ...
3 1/6, 2/6, 3/6.....
4 XP1, XP2, XP3 ...

I find that it is very time consuming and tedious to rename large number of
pages.

Thanks

Low

--
A36B58K641


--

Dave Peterson

David McRitchie

Excel 2002 : Can I speed fill tabs ?
 
Adding to Dave's reply, the worksheet names are text, and
I would suggest naming worksheets with sorting in mind. Name a dated
worksheet as yyyy-mm-dd to keep out of trouble instead of mm-dd-yy
or mmm-dd. Use yyyy_mmdd if you want it a little shorter name.

Sorting worksheets into tabname order
http://www.mvps.org/dmcritchie/excel...#sortallsheets

Same naming would be suggested for filenames in a directory that
are representing dates.

--
HTH,
David McRitchie, Microsoft MVP -- Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm


"Dave Peterson" wrote in message ...
You can use macros to do this kind of work--except for #3. You can't use
slashes in worksheet names.

#1.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = Format(DateSerial(2007, iCtr, 1), "mmm-yy")
Next wks

#2.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 1996
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = iCtr
Next wks

#2. (with 7 or less worksheets):
Dim iCtr As Long
For iCtr = 1 To 7
Worksheets(iCtr).Name = Format(iCtr, "ddd")
Next iCtr

#4.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = "XP" & iCtr
Next wks




Mr. Low wrote:

Dear Sir,

My I know if I can speed fill the name of each worksheet (tab) in certain
sequence such as :

1 Jan-07, Feb07, Mar-07....
2. 1997, 1998, 1999, 2000 ...
2. Sun, Mon Tue, Wed ...
3 1/6, 2/6, 3/6.....
4 XP1, XP2, XP3 ...

I find that it is very time consuming and tedious to rename large number of
pages.

Thanks

Low

--
A36B58K641


--

Dave Peterson


Mr. Low

Excel 2002 : Can I speed fill tabs ?
 
Hello Dave,

Thanks for the info.

Low
--
A36B58K641


"Dave Peterson" wrote:

You can use macros to do this kind of work--except for #3. You can't use
slashes in worksheet names.

#1.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = Format(DateSerial(2007, iCtr, 1), "mmm-yy")
Next wks

#2.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 1996
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = iCtr
Next wks

#2. (with 7 or less worksheets):
Dim iCtr As Long
For iCtr = 1 To 7
Worksheets(iCtr).Name = Format(iCtr, "ddd")
Next iCtr

#4.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = "XP" & iCtr
Next wks




Mr. Low wrote:

Dear Sir,

My I know if I can speed fill the name of each worksheet (tab) in certain
sequence such as :

1 Jan-07, Feb07, Mar-07....
2. 1997, 1998, 1999, 2000 ...
2. Sun, Mon Tue, Wed ...
3 1/6, 2/6, 3/6.....
4 XP1, XP2, XP3 ...

I find that it is very time consuming and tedious to rename large number of
pages.

Thanks

Low

--
A36B58K641


--

Dave Peterson


Mr. Low

Excel 2002 : Can I speed fill tabs ?
 
Hello David,

Thanks for the info.

Low

--
A36B58K641


"David McRitchie" wrote:

Adding to Dave's reply, the worksheet names are text, and
I would suggest naming worksheets with sorting in mind. Name a dated
worksheet as yyyy-mm-dd to keep out of trouble instead of mm-dd-yy
or mmm-dd. Use yyyy_mmdd if you want it a little shorter name.

Sorting worksheets into tabname order
http://www.mvps.org/dmcritchie/excel...#sortallsheets

Same naming would be suggested for filenames in a directory that
are representing dates.

--
HTH,
David McRitchie, Microsoft MVP -- Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm


"Dave Peterson" wrote in message ...
You can use macros to do this kind of work--except for #3. You can't use
slashes in worksheet names.

#1.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = Format(DateSerial(2007, iCtr, 1), "mmm-yy")
Next wks

#2.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 1996
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = iCtr
Next wks

#2. (with 7 or less worksheets):
Dim iCtr As Long
For iCtr = 1 To 7
Worksheets(iCtr).Name = Format(iCtr, "ddd")
Next iCtr

#4.
Dim iCtr As Long
Dim wks As Worksheet
iCtr = 0
For Each wks In ActiveWorkbook.Worksheets
iCtr = iCtr + 1
wks.Name = "XP" & iCtr
Next wks




Mr. Low wrote:

Dear Sir,

My I know if I can speed fill the name of each worksheet (tab) in certain
sequence such as :

1 Jan-07, Feb07, Mar-07....
2. 1997, 1998, 1999, 2000 ...
2. Sun, Mon Tue, Wed ...
3 1/6, 2/6, 3/6.....
4 XP1, XP2, XP3 ...

I find that it is very time consuming and tedious to rename large number of
pages.

Thanks

Low

--
A36B58K641


--

Dave Peterson




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

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