VBA Help

R

rk0909

Hello,
Would appreciate a quick response.
I need to define an event which triggers a macro if a particular cell in a
sheet is changed. I could find an event for change in the workseet but no for
a particular cell.
Thanks in advance,
rk
 
N

NAVEEN

Hi

Yes, there is no such procedure in Excel. But you can check that the changed
cell is the one you wanted. The following piece of code will help you.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 2 Then
MsgBox "This is the thing that rk0909 wanted"
End If
End Sub

With kind regards,

NAVEEN
 
R

rk0909

Naveen, thanks a lot it just worked fine.
RK

NAVEEN said:
Hi

Yes, there is no such procedure in Excel. But you can check that the changed
cell is the one you wanted. The following piece of code will help you.

Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Row = 3 And Target.Column = 2 Then
MsgBox "This is the thing that rk0909 wanted"
End If
End Sub

With kind regards,

NAVEEN
 
Top