Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,480
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,058
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 270
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I change a Worksheet_change event to a beforesave event? Tueanker Excel Programming 5 June 29th 07 03:00 PM
Worksheet_Change event Tom Ogilvy Excel Programming 1 January 24th 07 06:56 PM
Worksheet_change event. Mike K Excel Programming 8 October 24th 04 09:00 PM
Worksheet_change event Dwayne Smith Excel Programming 2 June 5th 04 03:25 AM
Worksheet_Change Event Sam Excel Programming 2 November 21st 03 06:51 PM


All times are GMT +1. The time now is 04:05 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"