Find and Replace Sheet names

F

FARAZ QURESHI

Any idea/code for changing the names of worksheets' names in a single go!
For instance,
Converting sheet names like the following:

Sheet(1)
Sheet(2)
Sheet(3)
Sheet(4)
Sheet(5) ...

as follows:

Sheet-1
Sheet-2
Sheet-3
Sheet-4
Sheet-5 ...

Thanx in advance
 
S

Sheeloo

Use the macro
Sub rename_Sheets()
i = 1
For Each ws In Worksheets
ws.Name = "Sheet-" & i
i = i + 1
Next
End Sub
 
S

Shane Devenshire

Hi,

Here is another alternative which assumes that the sheets may not all be
number in order and that some of the sheets may not need to be renamed
because they aren't numbered in the said manner:

Sub Rename()
Dim ws As Worksheet
On Error Resume Next
For Each ws In Worksheets
ws.Name = Replace(Replace(ws.Name, "(", "-"), ")", "")
Next ws
End Sub
 
Top