Loop until

Ralph M

Well-known Member
Joined
Apr 16, 2002
Messages
502
Office Version
  1. 2016
Platform
  1. Windows
I am using a Macro for Text-To-Column, I would like it to loop until there is no more data in the next cell down. I do not know how to write this, appreciate any help, Thanks
 

Excel Facts

Remove leading & trailing spaces
Save as CSV to remove all leading and trailing spaces. It is faster than using TRIM().
Can you post what existing code you have?

And also an explanation of what you are trying to do?
 
Upvote 0
Here is my code, I'm separating text and putting it into columns, I just want this to loop until there is no more text.

Selection.TextToColumns Destination:=Cells(ActiveCell.Row, 2), DataType:= _
xlFixedWidth, FieldInfo:=Array(Array(0, 3), Array(15, 2), Array(37, 2)), _
TrailingMinusNumbers:=True
Cells(ActiveCell.Row, 4).Select
Selection.TextToColumns Destination:=Cells(ActiveCell.Row, 4), DataType:=xlDelimited, TextQualifier:=xlDoubleQuote, ConsecutiveDelimiter:=False, Tab:=False, _
Semicolon:=False, Comma:=False, Space:=False, Other:=True, OtherChar _
:="-", FieldInfo:=Array(Array(1, 2), Array(2, 2), Array(3, 2)), _
TrailingMinusNumbers:=True
ActiveCell.Offset(1, -2).Select
 
Upvote 0
Why are you doing it cell by cell?

Can you not select the whole column and just do it once?
 
Upvote 0
So why can't you select the whole column rather than individual cells?
 
Upvote 0
Because every day that I add more data I run the text-to-column
Can you show me how to write it?
 
Upvote 0
Sorry

I think I get what you mean now - you only want to Text To Columns the new data.

Perhaps you could explain what you are doing further.

How are you adding the new data and where to?
 
Upvote 0
Please just tell me how to do a Loop until there is no more Data to separate.
 
Upvote 0

Forum statistics

Threads
1,213,543
Messages
6,114,243
Members
448,555
Latest member
RobertJones1986

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