PDA

View Full Version : Extract data into multiple cells



cynicaljenna
12-09-2015, 11:34 AM
I have a couple thousand cells with a combination of numbers 1 thorough 24. Example: Cell 1 may read "1, 3" and cell 2 may read "1, 2, 4, 6, 7, 10, 11, 15, 23, 22". I know there is a way to extract specific data from cells and insert it into another, but is there a code that would allow me to extract each number and place it into the appropriate cell? "1" in the first cell, "2" in the second, etc.

I'm still new to VBA and playing around with the code hasn't been very fruitful. Any ideas? Thanks!

p45cal
12-10-2015, 07:34 AM
select the cells then maybe:
Sub blah()
Selection.TextToColumns DataType:=xlDelimited, ConsecutiveDelimiter:=True, Comma:=True, Space:=True
End Sub
?