Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet_Change event
How can I go through a "Worksheet_Change" event manually to check the code
is working as intended? I believe inserting a breakpoint after 1st line is a start but I don't know how to do that! Step by step would be good! Sandy |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet_Change event
Hi Sandy
Right click on sheet tabView Code In the grey bar on the left side of the code window, click opposite the line of code where you want to pause. This will highlight the row (Brown in my case). Return to your spreadsheet by pressing Alt + F11 Do the operation that should trigger the code, and return to the code window. If the code is running, then part of the marked line will be highlighted Yellow. Using the F8 button you can step through the remaining lines of code. If the code is not running, it could be that Application.EnableEvents has been switched off. In the Immediate window of the VBE (press Control+G to make it viewable, if not already shown) enter Application.EnableEvents = True and press Enter Then try invoking the code again. -- Regards Roger Govier "Sandy" wrote in message ... How can I go through a "Worksheet_Change" event manually to check the code is working as intended? I believe inserting a breakpoint after 1st line is a start but I don't know how to do that! Step by step would be good! Sandy |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet_Change event
Private Sub Worksheet_Change(ByVal Target As Range)
Call sandy End Sub and in a standard module: Sub sandy() MsgBox ("hi") End Sub If sandy needs Target, have the Event code save Target in a public variable and then modify sandy to use the public variable. -- Gary''s Student - gsnu200735 "Sandy" wrote: How can I go through a "Worksheet_Change" event manually to check the code is working as intended? I believe inserting a breakpoint after 1st line is a start but I don't know how to do that! Step by step would be good! Sandy |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Worksheet_Change event
Thank you both - Roger's explanation was the one I was really after.
Nice way to check it's running though Gary. Sandy "Roger Govier" <rogerattechnology4NOSPAMu.co.uk wrote in message ... Hi Sandy Right click on sheet tabView Code In the grey bar on the left side of the code window, click opposite the line of code where you want to pause. This will highlight the row (Brown in my case). Return to your spreadsheet by pressing Alt + F11 Do the operation that should trigger the code, and return to the code window. If the code is running, then part of the marked line will be highlighted Yellow. Using the F8 button you can step through the remaining lines of code. If the code is not running, it could be that Application.EnableEvents has been switched off. In the Immediate window of the VBE (press Control+G to make it viewable, if not already shown) enter Application.EnableEvents = True and press Enter Then try invoking the code again. -- Regards Roger Govier "Sandy" wrote in message ... How can I go through a "Worksheet_Change" event manually to check the code is working as intended? I believe inserting a breakpoint after 1st line is a start but I don't know how to do that! Step by step would be good! Sandy |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How do I change a Worksheet_change event to a beforesave event? | Excel Programming | |||
Worksheet_Change event | Excel Programming | |||
Worksheet_change event. | Excel Programming | |||
Worksheet_change event | Excel Programming | |||
Worksheet_Change Event | Excel Programming |