Hi
I thing this may solve the proble
- Sub SheetNames()
-
Columns(1).Insert
-
For i = 1 To Sheets.Count
-
Cells(i, 1).NumberFormat = "@"
-
Cells(i, 1) = Sheets(i).Name
-
Next iEnd Sub
In short, the string is returned to the spreadsheet but the sheet then assumes it is a number, so you need to change the format to the Cell, in this example it formats it as text.
Alternatively you could format the cell with 4 leading zeros ie
- Columns(1).Insert
-
For i = 1 To Sheets.Count
-
Cells(i, 1).NumberFormat = "0000"
-
Cells(i, 1) = Sheets(i).Name
-
Next i
HTH
MTB