Avatar of Ian Bell
Ian Bell
Flag for United Kingdom of Great Britain and Northern Ireland asked on

Import comma separated data from a single cell

I would like to display the comma separated numbers contained in a single cell into individual cells.
As under

Before
 A1
3.49,4.90,1,-3.49,9870.03
After
A1       A2        A3         A4          A5
3.49    4.90      1         -3.49       9870.03

Many Thanks
Ian
Microsoft Excel

Avatar of undefined
Last Comment
Ian Bell

8/22/2022 - Mon
Subodh Tiwari (Neeraj)

Try this....

Sub SplitCommaSeparatedCellIntoMultipleCells()
Dim arr
arr = Split(Range("A1").Value, ",")
Range("A1").Resize(UBound(arr) + 1).Value = Application.Transpose(arr)
End Sub

Open in new window

Ian Bell

ASKER
Hi Sktneer,
Thanks for this, however I am a novice when it comes to code. Can you tell me where to enter it and the steps to do so
Thanks
Ian
ASKER CERTIFIED SOLUTION
Professor J

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Ian Bell

ASKER
Thanks, that worked a treat.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23