Triggers

  • Thread starter Thread starter Randy Numbers
  • Start date Start date
R

Randy Numbers

Greetings...

I'm getting more and more sophsiticated -- but its getting scarier and
scarier...

I'd like to have a macro run when a user changes the value in a certain cell
(via a dropdown picklist).

The macro hides certain lines depending upon the view chosen. How can I do
this? I know marcro's need to be RUN explicitly -- yet there seems to be
some sort of EVENT command.

Many thanks.../Randy
 
Randy,

There are plenty of events that happen in Excel. Go to the sheet module for
your sheet (double-click it in the Project Explorer to open the code
window). Open the Object dropdown (above the code window at left --
probably says (general) right now), and select Worksheet. Now the Procedure
dropdown (right side) will have all the events. Select one, and it puts a
stub for that event, into which you can put your code. It might look like
this:

Private Sub Worksheet_Change(ByVal Target As Range)

' is the target cell A1?:
If Not Intersect(Target, Range("A1")) Is Nothing Then
' your code here
End If
End Sub
 
Back
Top