View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
Will Cendrowski Will Cendrowski is offline
external usenet poster
 
Posts: 1
Default Auto naming Worksheets

I am trying to rename worksheets and used a macro found in one of the threads:

Sub name_um()
For Each ws In Worksheets
ws.Name = ws.Range("A1").Value
Next
End Sub

It works...but A1 on the numerous worksheets get their value from cells the
first worksheet. Some of the cells in the first worksheet have no value.

I am getting an when the macro comes to a worksheet that does not have a
value in A1. How can I get the program to skip that worksheet?

Please be easy in your response, as I am new to Macros.