View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.setup
Bob Phillips
 
Posts: n/a
Default Macro to convert Name of worksheet


Dim iPos As Long
Dim wks As Worksheet

For Each wks In ActiveWorkbook.Worksheets
On Error Resume Next
iPos = Application.Match(wks.Name, Range("LongNames"), 0)
On Error GoTo 0
If iPos 0 Then
wks.Name = Range("ShortNames").Cells(iPos, 1)
End If
Next wks


--

HTH

RP
(remove nothere from the email address if mailing direct)


"G" wrote in message
...
I want to change the name of all the worksheets by using a table in

another
worksheet. The table contains one column for long names and another

column
for short names. When the current worksheet name matches the long name
column, the name is change to the short name.

Thanks,
G