+ Reply to Thread
Results 1 to 5 of 5

Two numbers in one cell put into two separate variables.

  1. #1
    Registered User
    Join Date
    09-16-2012
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Two numbers in one cell put into two separate variables.

    Hi again all.
    I need your help again please. I want to put 2 numbers in one cell say: "14 space 3" into two separate variables. Is this possible? If so, how do I do it.
    Many thanks in advance.
    Jim

  2. #2
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Two numbers in one cell put into two separate variables.

    not sure if i understand you correctly, but try this, assuming your data is in A1 and B1...

    =A1&" "&B1

    let me know if this was what you want. if not, try to explain better and/or upload a sample worksheet (NOT a pic)
    1. Use code tags for VBA. [code] Your Code [/code] (or use the # button)
    2. If your question is resolved, mark it SOLVED using the thread tools
    3. Click on the star if you think someone helped you

    Regards
    Ford

  3. #3
    Registered User
    Join Date
    09-16-2012
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2003
    Posts
    11

    Re: Two numbers in one cell put into two separate variables.

    Hi
    Thanks for your reply. What I've got is, two numbers in one cell IE: in cell A4 I might have the number 14 then a space and then the number 3 both in cell A4. What I want to know is, is it possible for VBA to look in the cell and put the number 14 into one variable and then put the number 3 into another variable?

  4. #4
    Forum Expert mike7952's Avatar
    Join Date
    12-17-2011
    Location
    Florida
    MS-Off Ver
    Excel 2007, Excel 2016
    Posts
    3,520

    Re: Two numbers in one cell put into two separate variables.

    You can do this as long as there will always be Number space Number

    Please Login or Register  to view this content.
    Thanks,
    Mike

    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved.

  5. #5
    Administrator FDibbins's Avatar
    Join Date
    12-29-2011
    Location
    Duncansville, PA USA
    MS-Off Ver
    Excel 7/10/13/16/365 (PC ver 2310)
    Posts
    52,944

    Re: Two numbers in one cell put into two separate variables.

    if there is consitance in your data, yo could do this with a formula too, using =left() and right()

+ 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