Sub Renamesheetloop()
For Each ws In Worksheets
on error resume next
ws.Name = ws.Range("A1").Value
on error goto 0
Next ws
End Sub
or
Sub Renamesheetloop()
For Each ws In Worksheets
on error resume next
ws.Name = ws.Range("A1").Value
if err.number = 0 then
'ok
else
msgbox "rename of sheet: " & ws.name & " failed"
err.clear
end if
on error goto 0
Next ws
End Sub
wrote:
Can anybody modify macro below to make it continue running even if it
can't rename a worksheet (sheetname can't take cell content) i.e
rename all other sheets.
Sub Renamesheetloop()
For Each ws In Worksheets
ws.Name = ws.Range("A1").Value
Next ws
End Sub
Thxs
--
Dave Peterson