I need to know how to have my validation macro run everytime i change
the contents of a cell. I've tried putting the macro name in the
Worksheet_Change Source but it seems to be stuck in a loop. Any help?
I need to know how to have my validation macro run everytime i change
the contents of a cell. I've tried putting the macro name in the
Worksheet_Change Source but it seems to be stuck in a loop. Any help?
If your macro is updating the sheet then that will again cause the Change
event to fire.
Try something like this in the change event:
'*******************************
Static bInProgress as boolean
if bInProgress then exit sub
bInProgress=True
'..... do your stuff
bInProgress=False
'*******************************
--
Tim Williams
Palo Alto, CA
<[email protected]> wrote in message
news:[email protected]...
> I need to know how to have my validation macro run everytime i change
> the contents of a cell. I've tried putting the macro name in the
> Worksheet_Change Source but it seems to be stuck in a loop. Any help?
>
Try This, just change the address between the quotes to suit your
needs.
Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo DoNothing
If Target.Address = "$A$1" Then
MsgBox "This works"
End If
Exit Sub
DoNothing:
End Sub
This will avoid running into a continuos loop
before the end of your macro,
a1=11 or something
“[email protected]”编写:
> I need to know how to have my validation macro run everytime i change
> the contents of a cell. I've tried putting the macro name in the
> Worksheet_Change Source but it seems to be stuck in a loop. Any help?
>
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks