Using loop for selection macro

A

akoobra

Hi all

I am having trouble automatically stopping this macro. I can run it
and then end but would prefer to have it stop automatically.

Do
ActiveCell.Columns("A:A").EntireColumn.Select
Selection.Find(what:="TL", After:=ActiveCell, LookIn:=xlValues,
LookAt _
:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext,
MatchCase:= _
False).Activate
ActiveCell.Range("A1:U1").Select
Selection.Cut
ActiveCell.Offset(-1, 10).Range("A1").Select
ActiveSheet.Paste
ActiveCell.Offset(1, 0).Rows("1:1").EntireRow.Select
Selection.ClearContents
Selection.Delete Shift:=xlUp
Loop


End Sub

Any help would be appreciated.

Richard
 
G

Guest

you don't have a way to stop it.
do then loop.
you need to put in do until.....something.
or loop until or while....something.
when something happens the code will exit the loop.
 

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