Closed Thread
Results 1 to 5 of 5

Macro to convert the text in to string?

  1. #1
    Registered User
    Join Date
    10-21-2010
    Location
    Akron,OH, USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Question Macro to convert the text in to string?

    I have a text file with lines. All I want to do is convert line text into number. I want to declare them as array.and output them in different cells in worksheet.
    Example:
    if one of the text line is-

    Text input:
    C39000779710904010000053000000003100004000000000000002000000000000016

    Excel output:
    A1 B1 C1 D1 E1 F1 G1 H1 I1 J1 K1 L1 M1 N1 O1 P1 Q1 R1 S1
    C 39 000779 7 1 09 04 01 00 00053 00000 00031 00004 00000 00000 00002 00000 00000 00016
    (1 2 6 1 1 2 2 2 2 5 5 5 5 5 5 5 5 5 5) -> Length on the numbers
    the text file has several lines. So there should be a loop to go through the end of file.
    Please help me.
    Last edited by mithil; 11-02-2010 at 08:50 AM.

  2. #2
    Forum Moderator davesexcel's Avatar
    Join Date
    02-19-2006
    Location
    Regina
    MS-Off Ver
    MS 365
    Posts
    13,482

    Re: Macro to convert the text in to string?

    How do you know what zeros to keep?

  3. #3
    Registered User
    Join Date
    10-21-2010
    Location
    Akron,OH, USA
    MS-Off Ver
    Excel 2007
    Posts
    44

    Re: Macro to convert the text in to string?

    see I have added the length of the cells.

  4. #4
    Forum Expert snb's Avatar
    Join Date
    05-09-2010
    Location
    VBA
    MS-Off Ver
    Redhat
    Posts
    5,649

    Re: Macro to convert the text in to string?

    @Mithil

    You are crossposting in the same forum.
    You already got the answer.



  5. #5
    Forum Expert NBVC's Avatar
    Join Date
    12-06-2006
    Location
    Mississauga, CANADA
    MS-Off Ver
    2003:2010
    Posts
    34,898

    Re: Macro to convert the text in to string?

    This is a duplicate post and as such does not comply with Rule 5 of our forum rules. This thread will now be closed, you may continue in your other thread.

    Thread Closed.
    Where there is a will there are many ways.

    If you are happy with the results, please add to the contributor's reputation by clicking the reputation icon (star icon) below left corner

    Please also mark the thread as Solved once it is solved. Check the FAQ's to see how.

Closed Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1