View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.misc
Dileep Chandran Dileep Chandran is offline
external usenet poster
 
Posts: 101
Default Get WorkSheet Name without a reason

Hi Mike,

Thanks for your reply. I have the same code. But it still fails to
work without opening the code and refresh.

Heres my code:

Sub WsNames()

Dim i As Long
Dim Sh As Worksheet
i = 6


For Each Sh In ActiveWorkbook.Sheets

Range("B" & i) = Sh.Name
Range("A" & i) = Sh.CodeName
i = i + 1

Next

End Sub

Any idea to rectify?

Thanks

DC