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

Can someone please help this complete newbie where macros & VBA are
concerned?
I've obtained a macro from the web which does exactly what I was looking for
but I now need to tweak it a bit.
[for info: it generates random numbers in certain cells]

a) I would like it to *loop* until certain criteria are met e.g. "A1=7"
_and_ "B1 20"

b) I would also like to be able to stop it manually [e.g. by pressing a
certain key] to prevent it going into a permanent loop.

BTW I'm using Excel 2002

Any help appreciated
TIA

Tony


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Stopping a Looping Macro


you could use a do until loop like this

dim rg as range

Do

your macro

Set rg = (insert the cell to check here)

Loop Until rg.Value = somethin

--
dropste
-----------------------------------------------------------------------
dropster's Profile: http://www.excelforum.com/member.php...fo&userid=1339
View this thread: http://www.excelforum.com/showthread.php?threadid=27313

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 134
Default Stopping a Looping Macro

hi,
To stop a macro use Ctrl+Break.
but for the loop, maybe posting your code would help.

regards
Frank

-----Original Message-----
Can someone please help this complete newbie where macros

& VBA are
concerned?
I've obtained a macro from the web which does exactly

what I was looking for
but I now need to tweak it a bit.
[for info: it generates random numbers in certain cells]

a) I would like it to *loop* until certain criteria are

met e.g. "A1=7"
_and_ "B1 20"

b) I would also like to be able to stop it manually [e.g.

by pressing a
certain key] to prevent it going into a permanent loop.

BTW I'm using Excel 2002

Any help appreciated
TIA

Tony


.

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
looping and stopping cont april Excel Discussion (Misc queries) 1 October 22nd 09 12:01 AM
looping and stopping when a condition is met - test april Excel Discussion (Misc queries) 1 October 21st 09 11:36 PM
stopping code from looping tjb Excel Worksheet Functions 3 December 7th 05 02:02 AM
stopping macro DPK Excel Programming 3 May 13th 04 06:50 AM
My Macro keeps stopping?? Sh0t2bts Excel Programming 5 October 28th 03 03:08 PM


All times are GMT +1. The time now is 04: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"