PDA

View Full Version : Solved: Comma Delimited Data Arranging



Mcygee
03-12-2009, 01:50 PM
Sorry for my ignorance, but I'm learning. If anybody knows of a solution posted elsewhere please direct me there because I couldn't find it. Here is what I need to know how to do...

I need to take comma delimited column like this....

----------< A >
<1> Math, B4, Chris Able

and place each entry into the column I want. I want to make it look like this (substituting dashes for spaces due to the formatting of the forums)...

------------< A > -------< B >---------- < C > -----------< D >
<1> -------------------Chris Able --------Math -------------B4

Then this macro will repeat down as many rows as there is data until no more rows are left.

I'm not asking for anybody to write this thing out for me, but what I'm looking for is the string I need to pull the data separately between each comma and then place it where I want and then repeat until there's no more rows.

I would really appreciate any help I can get on this. Even if it's just a nudge in the right direction.

THANKS!

mdmackillop
03-12-2009, 02:07 PM
Hi Mcygee
Welcome to VBAX
You can post workbooks using Manage Attachments in the Go Advanced rely section.

In this case, look at Data/TextToColumns. That should help accomplish your task.

Bob Phillips
03-12-2009, 02:13 PM
Columns("A").TextToColumns Destination:=Range("A1"), DataType:=xlDelimited, _
TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
Semicolon:=False, Comma:=True, Space:=False, Other:=False, FieldInfo _
:=Array(Array(1, 1), Array(2, 1), Array(3, 1)), TrailingMinusNumbers:=True
Columns("A").Cut Range("D1")
Columns("B").Cut Range("E1")
Columns("B").Delete

Mcygee
03-13-2009, 06:46 AM
Thank you both for your responses. I'm doing this for a school district I work for and if I can accomplish what I want to it will save many people a LOT of time. Today is the last day before spring break so I may not have much of a chance to work on it before next week. I'll study what you have given me and see if I can work it out, if I need more help I'll make sure and ask. THANK YOU!

Mcygee
03-23-2009, 07:31 AM
THANKS A TON!!!!

XLD your code allowed me to do exactly what I wanted. Thank you!