Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() HI again, I apologise for my persistence but im really stuck!! Can someone sho me how to apply so that my click event runs only once?? Thanks in advance! -- gavme ----------------------------------------------------------------------- gavmer's Profile: http://www.excelforum.com/member.php...nfo&userid=666 View this thread: http://www.excelforum.com/showthread.php?threadid=26497 |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
One way to do it is to use a Static variable, so it
retains its value between calls. If you use a Boolean, you can use it to flag when the sub has been run previously, and if so to abort processing the code; e.g: Sub Button1_Click() Static Pressed As Boolean If Not(Pressed) Then ' Insert your code here End If Pressed = True End Sub First time this is run, Pressed starts out false so your code runs. But then Pressed is set to True and the value is retained between calls - so next time it will fail the IF statement and the code will be bypassed. K Dales -----Original Message----- HI again, I apologise for my persistence but im really stuck!! Can someone show me how to apply so that my click event runs only once?? Thanks in advance!! -- gavmer ---------------------------------------------------------- -------------- gavmer's Profile: http://www.excelforum.com/member.php? action=getinfo&userid=6662 View this thread: http://www.excelforum.com/showthread...hreadid=264970 . |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Click event to run only once | Excel Programming | |||
Click event to run only once | Excel Programming | |||
Click event to run only once | Excel Programming | |||
Before Right Click event | Excel Programming | |||
Click Event | Excel Programming |