If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Macro works with a submit button, but doesn't through Worksheet_Change

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 11-07-10, 22:35
jamaicanmlaugh2 jamaicanmlaugh2 is offline
Registered User
 
Join Date: Nov 2010
Posts: 1
Macro works with a submit button, but doesn't through Worksheet_Change

I need help.

The attached excel database works when I press submit to accept the changes.

I would like it to do the same thing when I enter something into the cell and press enter.

The code works with the submit button, but the very same code does not work with Worksheet_Change which I cannot understand.

Can someone help me?

Thx
Attached Files
File Type: zip Need Help.zip (26.7 KB, 14 views)

Last edited by jamaicanmlaugh2; 11-07-10 at 22:48.
Reply With Quote
  #2 (permalink)  
Old 11-09-10, 12:40
Colin Legg Colin Legg is offline
Registered User
 
Join Date: Sep 2008
Location: London, UK
Posts: 495
Welcome to the forum.

I cannot open the attachment but I expect that the code within the Worksheet_Change event handler is changing the worksheet and hence causing the event handler to be called recursively. If that is the case you should temporarily disable events within the event handler. Note that you should use error handling to ensure that Application.EnableEvents is set back to True at the end of the process.

Hope that helps...
__________________
Colin

RAD Excel Blog

Other tutorials:
Array Formulas | Deleting Rows with VBA
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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