Macro output as Text

  • Thread starter Thread starter steph44haf
  • Start date Start date
S

steph44haf

I used the following Macro to list my tab names (which are dates):

Sub ListOfTabs()
For i = 1 To Sheets.Count
Cells(i, "f") = Sheets(i).Name
Next i
End Sub

But it listed the tab names as dates instead of text. Example: Tab Name =
09-01-08, but after macro runs output is 09/01/2008. How can I change the
Macro to get the proper output?

Any help is appreciated. Thanks!
 
Great - thanks!

Barb Reinhardt said:
One way

For i = 1 To Sheets.Count
Cells(i, "f") = "'" & Sheets(i).Name
Next i

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.
 
Back
Top