Worksheet names

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top