Loop until

Ralph M

Active Member
Joined
Apr 16, 2002
Messages
496
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
 

Some videos you may like

Excel Facts

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,230
Office Version
  1. 365
Platform
  1. Windows
Can you post what existing code you have?

And also an explanation of what you are trying to do?
 

Ralph M

Active Member
Joined
Apr 16, 2002
Messages
496
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
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,230
Office Version
  1. 365
Platform
  1. Windows
Why are you doing it cell by cell?

Can you not select the whole column and just do it once?
 

Ralph M

Active Member
Joined
Apr 16, 2002
Messages
496

ADVERTISEMENT

This is a sheet that I add to everyday.
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,230
Office Version
  1. 365
Platform
  1. Windows
So why can't you select the whole column rather than individual cells?
 

Ralph M

Active Member
Joined
Apr 16, 2002
Messages
496

ADVERTISEMENT

Because every day that I add more data I run the text-to-column
Can you show me how to write it?
 

Norie

Well-known Member
Joined
Apr 28, 2004
Messages
76,230
Office Version
  1. 365
Platform
  1. Windows
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?
 

Ralph M

Active Member
Joined
Apr 16, 2002
Messages
496
Please just tell me how to do a Loop until there is no more Data to separate.
 

Watch MrExcel Video

Forum statistics

Threads
1,123,281
Messages
5,600,720
Members
414,401
Latest member
grenona2020

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
Top