Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Looping VB Macro Need a STOP Button 1

Status
Not open for further replies.

Barneye

MIS
Mar 5, 2002
68
0
0
US
I wrote a VB Macro to feed data from an Excel sheet to an ActiveX Control that runs an LED sign.


This Macro is on a loop. I made a button to start it, can I make one to stop it?
 
Barneye,
Yep. Declare a global variable ([tt]blnStop[/tt]?) and have your button set it's value to false. Then in your looping code add something like:
Code:
If blnStop Then
  blnStop = False
  Exit Sub 'or Function
End If

Hope this helps,
CMP

[small]For the best results do what I'm thinking, not what I'm saying.[/small]
(GMT-07:00) Mountain Time (US & Canada)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top