Help with Text to Columns in VBA

ttbuson

Board Regular
Joined
Nov 18, 2011
Messages
80
I have a macro that imports data from the web and puts it into four different columns- A, H, O, and V. I'd like to space the web data out over 7 columns (so from A through G for the first column of data, H through N for the second column of data, and so on). When I tried using this piece of code multiple times, the debugger told me it could only be used on one column at a time. Does anybody know how to apply it to multiple columns in one macro?

Thanks in advance!

Code:
Range("A10").CurrentRegion.TextToColumns Destination:=Range("A10"), DataType:=xlDelimited, _
                TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=True, _
                Semicolon:=False, Comma:=True, Space:=False, Other:=False
 

Excel Facts

Can a formula spear through sheets?
Use =SUM(January:December!E7) to sum E7 on all of the sheets from January through December
Is it because the entries are too long for a conventional column


suggestion
1.text to columns and park data in adjacent columns
2.inserts the required number of column in between columns
3.merge the columns for e..g. A to G and make horizontal alignment as "centger"
 
Upvote 0
Thanks for the advice. Could you give some more guidance? I tried using some code I found on a forum, but it is not working. Do you have any code examples or would you mind helping me get started?

Thanks!
 
Upvote 0
post a small extract of your data and explain again with respect to this ample date what you want.
 
Upvote 0

Forum statistics

Threads
1,215,368
Messages
6,124,520
Members
449,169
Latest member
mm424

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top