PDA

View Full Version : [SOLVED] VBA to place combinations from cell to muliple cells essentially un merge them please



estatefinds
03-12-2016, 10:37 AM
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!

PAB
03-12-2016, 11:40 AM
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!

estatefinds
03-12-2016, 11:50 AM
wow!!! that worked great!!! Thank you very much!!!

PAB
03-12-2016, 11:59 AM
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.

estatefinds
03-12-2016, 12:16 PM
Your welcome! Thanks again! And you as well!