Macro output as Text

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!
 
B

Barb Reinhardt

One way

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

steph44haf

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top