Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Feb 20, 9:36*pm, jhong wrote:
Hi Everyone, I've got this very useful code from this forum, im running this code to my excel file that has plenty of sheets with cost centers as sheet names. My problem is each cost center starts with zero like 011888 when i run this code the macro will only get 11888 without the zero, can you help me edit this code so it an get all the code as it is. Thanks in advance!! Dim NewSheet As Variant Dim i As Integer Set NewSheet = Sheets.Add(Type:=xlWorksheet) For i = 1 To Sheets.Count * * NewSheet.Cells(i, 1).Value = Sheets(i).Name Next i Try this Dim NewSheet As Variant Dim i As Integer Set NewSheet = Sheets.Add(Type:=xlWorksheet) For i = 1 To Sheets.Count NewSheet.Cells(i, 1).NumberFormat = "@" NewSheet.Cells(i, 1).Value = Sheets(i).Name Next i |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Converting formatted text into a txt file | Excel Discussion (Misc queries) | |||
Converting Excel file to text delimited file | Excel Discussion (Misc queries) | |||
Converting a Text file to Excel | Excel Programming | |||
macro for converting text file to excel | Excel Programming | |||
macro for converting text file to excel | Excel Programming |