View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Darin Kramer Darin Kramer is offline
external usenet poster
 
Posts: 397
Default Worksheet _Calculate event handler_how to use

Here is the problem...

User selects from a drop down validation box an option (say option 1)

This displays a word(FAS in this example) in another Cell, say in E4.
I want an EVENT to run if cell E4 has a value - so if E4 has the value
"FAS," I want to call a Macro called FAS_UNhide. If E4 has ANY OTHER
VALUE (using a simple IF I can make this other value a NO), then I
want it to run another MACRO (called FAS_hide)

Using the Code as reflected below nothing happens UNTIL I MANUALLY GO
INTO CELL (E4) and press F2(ie function key 2). I need the event to run
when the cell contents are changed.... - NOW I THINK THE PROBLEM IS
BECAUSE I NEED TO USE THE worksheet_calculate event handler - BUT I
DONT KNOW HOW TO..... WHAT NEEDS changin BELOW...?
I would greatly appreciate any help


Attached code

Private Sub Worksheet_Change(ByVal Target As Excel.Range)

Sheets("Answers").Select

If Target.Address = "$E$4" Then
Application.EnableEvents = False
If Target.Value = "No" Then
Call FAS_Hide
End If

If Target.Value = "FAS" Then
Call FAS_Unhide

Application.EnableEvents = True
End If
End If
End Sub


*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!