![]() |
Converting CSV text in a single column, into multiple columns
I've got string data in the first (A) column of a spreadsheet. Each string
consists of comma separated substrings. I'd like to distribute the substrings out into their own columns, e.g., if An contains "hi,there,my,name,is", I'd like to put "hi" into Bn, "there" into Cn, "my" into Dn,"name" into En,"is" into Fn. It is easy to do this manually, but when I use the Macro Recorder to get the code to do it, the code doesn't work. Can anyone help? Thanks, Kerry Soileau |
Converting CSV text in a single column, into multiple columns
One way (manually):
Select your column. Choose Data/Text to columns... Select the Delimited radio button. Click Next. check the Comma checkbox. Click next. Put $B$1 in the destination box. click finish. One way (macro): Public Sub ParseCSV() With Selection .TextToColumns Destination:=.Offset(0, 1), _ DataType:=xlDelimited, _ TextQualifier:=xlDoubleQuote, _ ConsecutiveDelimiter:=False, _ Tab:=False, _ Semicolon:=False, _ Comma:=True, _ Space:=False, _ Other:=False End With End Sub Select the strings to convert (one column at a time) and run the macro. In article , "Kerry M. Soileau" wrote: I've got string data in the first (A) column of a spreadsheet. Each string consists of comma separated substrings. I'd like to distribute the substrings out into their own columns, e.g., if An contains "hi,there,my,name,is", I'd like to put "hi" into Bn, "there" into Cn, "my" into Dn,"name" into En,"is" into Fn. It is easy to do this manually, but when I use the Macro Recorder to get the code to do it, the code doesn't work. Can anyone help? Thanks, Kerry Soileau |
All times are GMT +1. The time now is 08:54 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com