+ Reply to Thread
Results 1 to 4 of 4

Adding text to columns

Hybrid View

  1. #1
    Registered User
    Join Date
    07-26-2011
    Location
    leicester england
    MS-Off Ver
    Excel 2007
    Posts
    20

    Adding text to columns

    Hello

    I am wiriting a VBA macro, to consolidate text into columns. This text is pasted from a pdf file , and is entered into column A, from here I would like the macro to seperate this into columns. The realy problem I have is that i do not know how to tell the macro to seperate text and numbers, also each pdf file has slightly different lenghts of words or numbers

    Example below

    Any help would be brilliant!
    Attached Files Attached Files
    Last edited by ben5496; 11-27-2011 at 01:25 PM.

  2. #2
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,167

    Re: Adding text to columns

    Do you have some more samples that you can provide? I worked out the Text to columns functionality in 2007 and the 1st row worked fine. Except that the text before the date got separated into 2 columns which can be merged into 1. (ghghghghghg & ghghghghg - can be merged using =A1&B1
    However, the 2nd row has a "-" which makes excel think that its a formula to subtract and gives the #VALUE error. If you can provide more samples, we can look to see if we can first have a procedure to change the "-" to some other character and then merge the data in the 2 columns and then re-input the "-". (mdmgfmgm -ffffff gets split as mdmgfmgm and -ffffff which creates the problem due to the - sign).
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

  3. #3
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Adding text to columns

    Pl see attached file. macro run will do your requirement.
    Any clarifications wel-come.
    Attached Files Attached Files
    Last edited by kvsrinivasamurthy; 11-24-2011 at 04:20 AM.

  4. #4
    Registered User
    Join Date
    07-26-2011
    Location
    leicester england
    MS-Off Ver
    Excel 2007
    Posts
    20

    Re: Adding text to columns

    Thank you that is brilliant

+ Reply to 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