LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Application.EnableEvents help

When a user first opens a template worksheet he clicks a button which runs a
macro containing unput boxes for him to input information. If, during the
course of filling out the worksheet, he changes the value in cell B5 or cel
E5 I need the input boxes to run again. In order to keep the first input
boxes from running continually, I know I need Application.EnableEvents in the
worksheet_change code. I can't get the worksheet_change code to work
properly, however. The initial input boxes either run continually or the
macros listed below don't run at all when B5 or E5 change. Can someone help
me fix the below code. Thanks.

fyi - I have 3 modules. The first one runs all input boxes. The one
referenced below called input_fieldsNoPartNumber runs all input boxes but the
partnumber box, which initially populates cell B5 and the module called
input_fieldsnochangelevel runs all input boxes except the change level field,
which initially populates cell E5.

code below is one of the many variations I've tried.

Private Sub Worksheet_Change(ByVal Target As Range)

If Target.Address = "$B$5" And Range("AA5").Value < "" Then
Application.EnableEvents = False
Call Input_FieldsNoPartNumber
'Application.EnableEvents = True
End If
'Exit Sub

If Target.Address = "$E$5" And Range("AA5").Value < "" Then
Application.EnableEvents = False
Call Input_FieldsNoChangeLevel
Application.EnableEvents = True
'Exit Sub
End If

End Sub
 
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
Application.EnableEvents DCPan Excel Worksheet Functions 3 October 18th 08 05:46 AM
Application.EnableEvents ... Is Local or Global ? monir Excel Programming 11 September 22nd 06 05:58 PM
application.EnableEvents nc Excel Discussion (Misc queries) 1 September 28th 05 04:00 PM
application.enableEvents jeffP Excel Programming 1 August 1st 04 03:12 PM
Application.EnableEvents Terry Excel Programming 2 April 2nd 04 08:25 PM


All times are GMT +1. The time now is 04:28 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"