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: 81
Default Worksheet_Calculate code in same module as Worksheet Change eventgoes astray

Hi, I'm trying to get some code to fire, based on a formula in cell E2
changing value to equal 1.

Private Sub Worksheet_Calculate()
If Cells(5, 2) = 1 Then MsgBox "Fires ok"
'Application.EnableEvents = False
End Sub

I can get it to work properly on a blank spreadsheet. However I need to
use it on a worksheet that already has a Worksheet Change code. Since it
seems like each worksheet can only have one module (page? not sure of
the right name) for code, the above code is in the same module as the
Change code.

Thus, when the entry is made that changes E2 to equal 1, it starts in
the above code, then jumps to the Change code and begins running some of
that code. If I EnableEvents=False it stops the straying, but still
doesn't bring up the MsgBox.

Any help would be appreciated.
Harold
 
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
Change A Line in A Module Using VBA Code derrick Excel Programming 1 July 3rd 08 02:01 PM
Code to change code in a sheet and workbook module Otto Moehrbach Excel Programming 11 November 11th 07 07:20 PM
Pass variables from Worksheet_Calculate sub to Module John Michl Excel Programming 2 June 22nd 06 04:12 PM
Run worksheet module code from workbook module? keithb Excel Programming 1 August 14th 05 04:04 AM
Create a newworksheet with VBA code and put VBA code in the new worksheet module ceshelman Excel Programming 4 June 15th 05 04:37 PM


All times are GMT +1. The time now is 01:36 AM.

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

About Us

"It's about Microsoft Excel"