View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.misc
terilad terilad is offline
external usenet poster
 
Posts: 141
Default 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



.