Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default Converting a file to text

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Converting formatted text into a txt file Marc Excel Discussion (Misc queries) 1 June 21st 07 04:00 PM
Converting Excel file to text delimited file Kiran Veeramallu[_2_] Excel Discussion (Misc queries) 3 May 1st 07 07:04 PM
Converting a Text file to Excel ExcelUser[_2_] Excel Programming 2 January 14th 04 03:42 PM
macro for converting text file to excel Tom Ogilvy Excel Programming 0 September 5th 03 12:49 PM
macro for converting text file to excel tomhaddock[_3_] Excel Programming 0 September 5th 03 11:40 AM


All times are GMT +1. The time now is 09:24 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"