+ Reply to Thread
Results 1 to 7 of 7

using text to column in VBA

  1. #1
    Forum Contributor
    Join Date
    01-13-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003, 2007
    Posts
    168

    using text to column in VBA

    Hi,

    I have a text in a single cell that has spaces, commas, excalamations, question marks etc. I want to convert this text into columns using text to column feature of excel in my macro..

    when i record text to column it does not give me a code that could be made dynamic..

    Can any one please suggest me a better way to do that?

    Regards,
    Vaibhav
    Last edited by c.vaibhav; 06-12-2010 at 06:23 AM.

  2. #2
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: using text to column in VBA

    In what way do you want to make it dynamic?

    Please Login or Register  to view this content.
    Cheers
    Andy
    www.andypope.info

  3. #3
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: using text to column in VBA

    Can you be a bit more explicit?

    Post a worksheet with some examples of your strings, and how and where you would like them to end up.

    [EDIT]

    Simultaneous postings

    Andy has given you the basic code
    Last edited by Marcol; 06-12-2010 at 06:01 AM.

  4. #4
    Forum Contributor
    Join Date
    01-13-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003, 2007
    Posts
    168

    Re: using text to column in VBA

    Thanks Andy.. thats exactly what i wanted..

    thank you very much..

    Regards,
    Vaibhav

  5. #5
    Forum Contributor
    Join Date
    01-13-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003, 2007
    Posts
    168

    Re: using text to column in VBA

    Here if we have multiple delimiters then how do we incorporate in the code..

    like here in your case you have used "!", but I would like to use "&", "^", and many other.

  6. #6
    Forum Guru Andy Pope's Avatar
    Join Date
    05-10-2004
    Location
    Essex, UK
    MS-Off Ver
    O365
    Posts
    20,481

    Re: using text to column in VBA

    The delimiter is a single character.

    To do multiple delimiters you will need to write code.

  7. #7
    Forum Contributor
    Join Date
    01-13-2009
    Location
    Mumbai
    MS-Off Ver
    Excel 2003, 2007
    Posts
    168

    Re: using text to column in VBA

    okay.. thanks..

    i thought there would be some internal function of excel..

    Regards,
    Vaibhav

+ 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