Take the 2-minute tour ×

I have a column where the data is something like this : 2, 3 I want to extract number 2 and put it under one column and extract 3 and put it in another column.

Please help me with this.

share|improve this question
What have you tried? Do you have any example code? –  Brian Hadaway Apr 24 '13 at 23:50
My actual req. is to import data from a *.csv file into specific columns in excel. I have done coding for importing from multiple columns but currently facing problems in one of the column where the data is in comma separated format. I have to extract the first number and place it in say column A and the other number after comma into say column H. –  rgm4kor Apr 24 '13 at 23:59

1 Answer 1

up vote 1 down vote accepted

Use the Text to Columns feature on the Data tab. In the menu, you'll select Delimited and on the next screen select Comma as your delimiter.

If you absolutely need to use VBA, you can use the Split function.

Split("42, 12, 19", ", ")

Will return the following array:

{"42", "12", "19"}

You can then paste those values into the columns.

share|improve this answer
i need to write a VBA macro to do this operation...can you please provide the code snippet for doing it through VBA macro –  rgm4kor Apr 24 '13 at 23:44
thanks mandroid... –  rgm4kor Apr 25 '13 at 12:59

Your Answer


