View Single Post
  #3   Report Post  
Don Guillett
 
Posts: n/a
Default

If you are trying to put the tab name into cell a1 on each sheet, use this
Sub shtname()
For Each sht In Worksheets
sht.Range("a1") = sht.Name
Next
End Sub

--
Don Guillett
SalesAid Software

"johnT" wrote in message
...
does anybody know why this doesn't work:

Private Sub Workbook_NewSheet(ByVal Sh As Object)
Set rng = Worksheets("Sheet1").Range("A1")
i = 1

For Each sht In Worksheets
rng(i, 1) = sht.Name
i = i + 1
Next
End Sub