+ Reply to Thread
Results 1 to 10 of 10

Macro to separate PO Numbers in cell and enter into separate cells

  1. #1
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Question Macro to separate PO Numbers in cell and enter into separate cells

    Hi,

    What I have is a list of PO Numbers in a column, however, some cells have one or more PO numbers and some cells have additional text. The PO numbers are all the same length i.e. 10 characters e.g. 4500038225 (N.B. some cells in the column may be blank i.e. have no PO numbers entered)

    What I would like is a macro that which remove any text and separate all the PO numbers and put them in to the corresponding cells in a separate column (please see attached example file where I have highlighted rows 2, 6 and 10 as examples)

    Any assistance on this matter would be greatly appreciated

    Many thanks in advance

    Regards

    Rob
    Attached Files Attached Files
    Rob

  2. #2
    Forum Expert José Augusto's Avatar
    Join Date
    10-29-2014
    Location
    Portugal
    MS-Off Ver
    2013-2016
    Posts
    3,329

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    Try in B2 the following formula and copy forward and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    Jose,

    many thanks for your response, it works only if there is no additional text in the cell !

    Any ideas how to resolve

    Regards


    Rob

  4. #4
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    Hi Rob
    Try this one
    Enter formula in B2 and copy across and down
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Or a bit shorter version
    Formula: copy to clipboard
    Please Login or Register  to view this content.

    Please see attached file
    Attached Files Attached Files
    Last edited by AlKey; 09-29-2016 at 11:47 AM.
    If you like my answer please click on * Add Reputation
    Don't forget to mark threads as "Solved" if your problem has been resolved

    "Nothing is so firmly believed as what we least know."
    --Michel de Montaigne

  5. #5
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    Alkey,

    many thanks for your response it is very much appreciated, however, could your code be refined a little as whilst it does what I wanted, when I tested it I just entered text into column 'A' instead of a PO number and/or PO number and text and it returned the text into column 'B'

    Any further assistance would be greatly appreciated

    Many thanks

    Regards


    Rob

  6. #6
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    Quote Originally Posted by robertguy View Post
    Alkey,

    many thanks for your response it is very much appreciated, however, could your code be refined a little as whilst it does what I wanted, when I tested it I just entered text into column 'A' instead of a PO number and/or PO number and text and it returned the text into column 'B'

    Any further assistance would be greatly appreciated

    Many thanks

    Regards


    Rob
    I don't think I understand your request. I would suggest to upload a spreadsheet and show the desired results.

  7. #7
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    AlKey

    please see the attached file, where I have entered only text into cells A3, A4 and A5 as opposed to a PO number or a PO number and text. As you can see the text in A3, A4 and A5 is populated into B3, B4 and B5. Is there away to modify your code only to populate the PO number

    Many thanks

    Regards

    Rob
    Attached Files Attached Files

  8. #8
    Registered User
    Join Date
    03-01-2013
    Location
    USA
    MS-Off Ver
    Excel 2007
    Posts
    28

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    Rob - What you would like to do is available in ASAP utilities. If you have never heard of it - you need to check it out. I hope I am not violating any rules on forum! I just wanted to help!

  9. #9
    Forum Guru AlKey's Avatar
    Join Date
    07-20-2009
    Location
    Lakeland, FL USA
    MS-Off Ver
    Microsoft Office 2010/ Office 365
    Posts
    8,903

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    Try this
    Formula: copy to clipboard
    Please Login or Register  to view this content.

  10. #10
    Forum Contributor
    Join Date
    02-09-2004
    Location
    Cardiff - Wales - UK
    MS-Off Ver
    2013
    Posts
    475

    Re: Macro to separate PO Numbers in cell and enter into separate cells

    AlKey

    EXCELLENT ! Just what I wanted, many many thanks for your assistance

    Thanks again

    Regards


    Rob

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. How To Separate Numbers Mixed with Text in separate Colum
    By muhammad.haq1974 in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 04-19-2016, 07:58 PM
  2. Replies: 5
    Last Post: 01-25-2016, 07:59 AM
  3. Separate numbers from one cell to two different cells
    By sharathnarayanan in forum Excel Formulas & Functions
    Replies: 12
    Last Post: 01-13-2016, 09:30 AM
  4. Split numbers in one cell deliminated by comma to separate cells
    By renix in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 04-27-2015, 02:07 PM
  5. [SOLVED] separate data from one cell into two separate cells question
    By lilsnoop in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-19-2012, 05:53 PM
  6. Replies: 10
    Last Post: 03-08-2012, 12:31 PM
  7. Replies: 3
    Last Post: 06-08-2005, 11:05 AM

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