+ Reply to Thread
Results 1 to 4 of 4

macro to split text/number string

  1. #1
    Registered User
    Join Date
    01-31-2013
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    2

    macro to split text/number string

    hi,

    im looking for pointers in creating a macro to split a text/number sting up.

    this is what i currently have in A1
    aaaa 31st Jan - 19:50 1a2b bbbb
    aaaa 1st Jan - 19:50 1a bbbb

    however i need to chop it up! so the result in cells M1,N1,O1 are
    M1 aaaa
    N1 1a2b or 1a
    O1 bbbb

    I need this so i can perform a lookup based on M,N,O. They need to be in different cells (i think) as each result appears in a seperate column on the look up table.

    or could i get a macro to perform the look up without splitting the A1 cell?

  2. #2
    Forum Expert
    Join Date
    01-15-2007
    Location
    Brisbane, Australia
    MS-Off Ver
    2007
    Posts
    6,591

    Re: macro to split text/number string

    Hi

    try a User Defined Function.

    put the code below into a general module

    Please Login or Register  to view this content.
    M1: =myfunc(a1,1)
    N1: =myfunc(a1,2)
    O1: =myfunc(a1,3)

    HTH

    rylo

  3. #3
    Forum Expert jaslake's Avatar
    Join Date
    02-21-2009
    Location
    Atwood Lake in Mid NE Ohio...look it up.
    MS-Off Ver
    Excel 2010 2019
    Posts
    12,749

    Re: macro to split text/number string

    Hi wbi

    You have this in A1?
    this is what i currently have in A1
    aaaa 31st Jan - 19:50 1a2b bbbb
    aaaa 1st Jan - 19:50 1a bbbb
    Does it look like this

    1-31-2013 9-24-10 PM.jpg

    I can't picture this...please show me in a worksheet.
    John

    If you have issues with Code I've provided, I appreciate your feedback.

    In the event Code provided resolves your issue, please mark your Thread as SOLVED.

    If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.

  4. #4
    Registered User
    Join Date
    01-31-2013
    Location
    england
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: macro to split text/number string

    lol, so simple once you see it done. Thank you very much rylo +1
    works like a dream and easly modified for my other sheets

+ 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