ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   rename default sheet numbers (https://www.excelbanter.com/excel-discussion-misc-queries/260825-rename-default-sheet-numbers.html)

terilad

rename default sheet numbers
 
Hi,

I have over 100 sheets in a workbook and through time they have been moved
around therefore default sheet numbers are all mixed, the sheets have names
and are in alphabetical order 1 to 110, is there a way to rename all the
sheets from 1 to 110 in there order as default sheet1 and so on to sheet110.

Thanks


Mark

Luke M[_4_]

rename default sheet numbers
 
'Try this macro:

'=============
Sub ReSequence()
'Destroy old names
For Each ws In ThisWorkbook.Worksheets
ws.Name = ws.Name & "xxxxxx"
Next
i = 1
'Give new names
For Each ws In ThisWorkbook.Worksheets
ws.Name = "Sheet" & i
i = i + 1
Next
End Sub
'===========

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

--
Best Regards,

Luke M
"terilad" wrote in message
...
Hi,

I have over 100 sheets in a workbook and through time they have been moved
around therefore default sheet numbers are all mixed, the sheets have
names
and are in alphabetical order 1 to 110, is there a way to rename all the
sheets from 1 to 110 in there order as default sheet1 and so on to
sheet110.

Thanks


Mark




מיכאל (מיקי) אבידן

rename default sheet numbers
 
I would suggest sorting the sheets in ascending order:
http://support.microsoft.com/default.aspx/kb/812386?p=1
Micky


"terilad" wrote:

Hi,

I have over 100 sheets in a workbook and through time they have been moved
around therefore default sheet numbers are all mixed, the sheets have names
and are in alphabetical order 1 to 110, is there a way to rename all the
sheets from 1 to 110 in there order as default sheet1 and so on to sheet110.

Thanks


Mark


terilad

rename default sheet numbers
 
This not working for what I need it to do, it is renaming the sheet tabs but
not the actual sheet numbers by default in VBA, the sheet has a name but also
has a number in brackets, this is what I need to reset.

Any ideas

Mark

"Luke M" wrote:

'Try this macro:

'=============
Sub ReSequence()
'Destroy old names
For Each ws In ThisWorkbook.Worksheets
ws.Name = ws.Name & "xxxxxx"
Next
i = 1
'Give new names
For Each ws In ThisWorkbook.Worksheets
ws.Name = "Sheet" & i
i = i + 1
Next
End Sub
'===========

If you're new to macros:

Debra Dalgleish has some notes how to implement macros he
http://www.contextures.com/xlvba01.html

David McRitchie has an intro to macros:
http://www.mvps.org/dmcritchie/excel/getstarted.htm

Ron de Bruin's intro to macros:
http://www.rondebruin.nl/code.htm

(General, Regular and Standard modules all describe the same thing.)

--
Best Regards,

Luke M
"terilad" wrote in message
...
Hi,

I have over 100 sheets in a workbook and through time they have been moved
around therefore default sheet numbers are all mixed, the sheets have
names
and are in alphabetical order 1 to 110, is there a way to rename all the
sheets from 1 to 110 in there order as default sheet1 and so on to
sheet110.

Thanks


Mark



.



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

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