As one of many subroutines in my project, there is a simple even
handler which triggers off a messagebox at the end of a loop
Structurally, the code looks like:
Private Sub ToggleButton1_Click()
For each sh in WorkSheets
<do something
k = k & something & vbcrlf
Next
MsgBox k
End Sub
Now, for some strange reason, when the ToggleButton is clicked, th
MsgBox comes up *twice* each time. This is irritating, to say the leas
and in my attempts to stop the nuisance I have tried the event variant
* Private Sub ToggleButton1_Change* and * Private Su
ToggleButton1_Enter*-to no avail. While the Change event acts the sam
way as the Click event (and shares the double movement problem), the
Enter event fires the MsgBox only once as desired but does not permit
repeat successive runs of the code.
For what it is worth, let me also remark that, when the code i
transplanted to a fresh userform and tested in its new enviroment, th
above problem disappears: the MsgBox springs up once and no more.
If anyone has the disgnostic eye for this problem, I welcome hi
with thanks.
David
--
david
-----------------------------------------------------------------------
davidm's Profile:
http://www.excelforum.com/member.php...fo&userid=2064
View this thread:
http://www.excelforum.com/showthread.php?threadid=48764