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

I have a workbook that has multiple worksheets. I would like to name the
worksheets and used a macro that I found in one of the threads:

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

The macro works great but their are some A1 cells in some of the sheets that
will not be named until the user completes a master form and the name is
filtered to the corresponding sheet.

Being new to the macro world, how can I have the macro skip the sheets that
have a 'null' value in A1?