Consulting

Results 1 to 5 of 5

Thread: VBA to place combinations from cell to muliple cells essentially un merge them please

  1. #1
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location

    VBA to place combinations from cell to muliple cells essentially un merge them please

    so I need a VBA to unmerge data in column A which contains five number combinations that are deliminited and place the these to the right in columns EFGHI and place the numbers within in the data smallest to greatest from left to right. see the attachment. Thank you!
    Attached Files Attached Files

  2. #2
    VBAX Tutor PAB's Avatar
    Joined
    Nov 2011
    Location
    London (UK)
    Posts
    243
    Location
    Good evening,

    How about something like this to start you off...

    Sub Text_2_Columns()
        Range("A11:A2248").Select
        Selection.TextToColumns Destination:=Range("A11"), DataType:=xlDelimited, _
            TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
            Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
            :="-", FieldInfo:=Array(Array(1, 1), Array(2, 1), Array(3, 1), Array(4, 1), Array(5, _
            1)), TrailingMinusNumbers:=True
    End Sub
    I hope this helps!
    -----------------------------------------∏-

    12:45, restate my assumptions.
    Mathematics is the language of nature.
    Everything around us can be represented and understood through numbers.
    If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.

    -----------------------------------------∏-

  3. #3
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location
    wow!!! that worked great!!! Thank you very much!!!

  4. #4
    VBAX Tutor PAB's Avatar
    Joined
    Nov 2011
    Location
    London (UK)
    Posts
    243
    Location
    You're welcome, thanks for the feedback.

    A none VBA way is as follows:

    Highlight column A by clicking on the A at the top of the Worksheet.

    Click Data
    Click Text To Columns
    Click Delimited
    Click Next
    Tick Other
    Enter A Dash (Minus Sign)
    Click Next
    Click Finish

    I hope this helps.

    Have a great weekend.
    -----------------------------------------∏-

    12:45, restate my assumptions.
    Mathematics is the language of nature.
    Everything around us can be represented and understood through numbers.
    If you graph the numbers of any system, patterns emerge. Therefore, there are patterns everywhere in nature.

    -----------------------------------------∏-

  5. #5
    VBAX Mentor
    Joined
    Feb 2016
    Posts
    382
    Location
    Your welcome! Thanks again! And you as well!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •