Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Using loop for selection macro

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

  #2   Report Post  
Posted to microsoft.public.excel.programming
No Name
 
Posts: n/a
Default Using loop for selection macro

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.

-----Original Message-----
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

.

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date selection loop Roger[_8_] Excel Programming 12 September 26th 04 12:53 AM
Help With loop macro?? pauluk[_28_] Excel Programming 1 April 16th 04 01:58 AM
I Need Help with my loop macro Pete Excel Programming 1 January 16th 04 04:02 PM
Loop macro help. Pete[_13_] Excel Programming 4 November 15th 03 01:22 AM
Loop macro help. Pete[_13_] Excel Programming 2 November 14th 03 10:32 PM


All times are GMT +1. The time now is 05:25 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"