LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 661
Default Stopping a Macro

Sorry, I don't understand. Range("A1").Select will take it back to A1, but I
think the tricky bit is working out if the macro has got to the bottom row.
The sheet is normally 10 - 20000 rows deep. It needs some code like"if this
row is the last row, go to A1 and stop"

Paul

"Bob Phillips" wrote:



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Paul" wrote in message
...
Hi,
Ive got the macro below to run, the only problem is stopping it when it

gets
to the bottom of the sheet and ending in an orderly fashion. Ideally I

would
like it to go back to A1 when it has got to the bottom of the sheet.
If anyone has any suggestions, they would be very much appreciated.
Thanks for looking.
Paul

Sub Macro4()
'
' Macro4 Macro
' Macro recorded 07/12/2005 by paul
'
' Keyboard Shortcut: Ctrl+z
'
Do
Cells.Find(What:="top 50", After:=ActiveCell, LookIn:=xlValues, LookAt

_
:=xlWhole, SearchOrder:=xlByColumns, SearchDirection:=xlNext,
MatchCase _
:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, -1).Select
Selection.Copy
ActiveCell.Offset(0, -2).Select
Cells.Find(What:="Total of all issues", After:=ActiveCell, LookIn:= _
xlValues, LookAt:=xlPart, SearchOrder:=xlByColumns,
SearchDirection:= _
xlNext, MatchCase:=False, SearchFormat:=False).Activate
ActiveCell.Offset(0, 1).Select
ActiveSheet.Paste
ActiveCell.Offset(0, 2).Select
Loop
End Sub




 
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
Protect macro from stopping saman110 via OfficeKB.com Excel Discussion (Misc queries) 1 August 16th 07 08:22 PM
Stopping a Looping Macro Tony Excel Programming 2 October 28th 04 12:17 PM
stopping macro DPK Excel Programming 3 May 13th 04 06:50 AM
Stopping an animation macro Ray Kanner[_2_] Excel Programming 3 November 23rd 03 11:40 PM
My Macro keeps stopping?? Sh0t2bts Excel Programming 5 October 28th 03 03:08 PM


All times are GMT +1. The time now is 03:59 AM.

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

About Us

"It's about Microsoft Excel"