Event when a specific cell changes

  • Thread starter Thread starter mohavv
  • Start date Start date
M

mohavv

Hi,

I want to run a macro after a specific cell value changes.
Cell A5 has a dropdown menu from which you have to choose one value.
After selecting I'd like a macro to start.

Have tried Event Workbook_Change but I'm doing something wrong because
it reacts on every cell change.

Cheers,

Harold
 
That workbook_Change event is going to fire each time you make a change to the
worksheet.

But you can get out of the procedure as soon as you realize you're not changing
the cell you want to check.

Option Explicit
Private Sub Worksheet_Change(ByVal Target As Range)

if target.cells.count > 1 then
exit sub 'only one cell at a time
end if

if intersect(target, me.range("A1")) is nothing then
'get out
exit sub
end if

'code to do real stuff here.
End Sub

To check specific cells:
if intersect(target, me.range("A1,c9,x92")) is nothing then
or
for any cell in column A
if intersect(target, me.range("A:A")) is nothing then
 
Back
Top