Worksheet names

A

Ajay

Afternoon All
Have looked through some of the previous threads but cant find exactly what
i am looking for.
Can I change part of a sheet name eg Gauge Recal 06-01-06 to Thread Recal
06-01-06?

In addition do this for all sheet names with Gauge at the front?

TIA
Ajay
 
J

JE McGimpsey

One way:

Public Sub ChangeGaugeToThread()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws
If .Name Like "Gauge*" Then _
.Name = "Thread" & Mid(.Name, 6)
End With
Next ws
End Sub
 
A

Ajay

Excellent so simple
Many thanks
Ajay

JE McGimpsey said:
One way:

Public Sub ChangeGaugeToThread()
Dim ws As Worksheet
For Each ws In ActiveWorkbook.Worksheets
With ws
If .Name Like "Gauge*" Then _
.Name = "Thread" & Mid(.Name, 6)
End With
Next ws
End Sub
 
Top