Text to Columns macro

T

Tonso

I would like to automate importing data from a program into XL2003. I
use the text to column feature with good results. I can record a macro
to automate this. What I want to do is take it 1 step further so i
dont have to select the 1st column.
After I paste the data in, the region selected maybe, for example,
B3:H20, or A5:J15. Currently if the selected region is B3:H20, I have
to then select B3:B20, then invoke the text to column macro i
recorded. I would like the macro to:
1. Paste the data in the worksheet, beginning at whatever cell is
currently selected.
2. Select the 1st column of the data.
3. Perform the text to column function.

How can I do this?

Thanks,

Tonso
 
G

Gord Dibben

After pasting the data to a range, select the activecell column range

Range(ActiveCell, Cells(Rows.Count, ActiveCell.Column).End(xlUp)).Select

Now perform your text to columns on that column.

Just out of curiosity.................What happens to the other columns adjacent
to active column?


Gord Dibben MS Excel MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top