I am looking for a way to run a macro when a cell in a range is changed. I
used the code that you suggested and each time a cell is changed, it goes
thru all the cells in that range. i only need it to work on the cell that is
change within a range of cells. How do I do this?
Thanks
> What would you like to happen?
>
[quoted text clipped - 32 lines]
> > range, nothing happens. What am I doing wrong here?
> > Thanks
SparkyUK - 16 Jan 2008 14:19 GMT
Try the UNION method with Target and drw1inforng ranges
> I am looking for a way to run a macro when a cell in a range is changed. I
> used the code that you suggested and each time a cell is changed, it goes
[quoted text clipped - 38 lines]
> > > range, nothing happens. What am I doing wrong here?
> > > Thanks
ranswert - 16 Jan 2008 14:22 GMT
Can you give me an example?
> Try the UNION method with Target and drw1inforng ranges
>
[quoted text clipped - 40 lines]
> > > > range, nothing happens. What am I doing wrong here?
> > > > Thanks
SparkyUK - 16 Jan 2008 14:37 GMT
Sorry should have used INTERSECT method:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim rngUnion As Range
Set rngUnion = Application.Intersect(Target, Me.Range("drw1inforng"))
If Not (rngUnion Is Nothing) Then
On Error GoTo stoppit
Application.EnableEvents = False
If rngUnion.Value <> "" Then MsgBox ("Not blank")
End If
stoppit:
Application.EnableEvents = True
End Sub
-----
> Can you give me an example?
>
[quoted text clipped - 42 lines]
> > > > > range, nothing happens. What am I doing wrong here?
> > > > > Thanks
ranswert - 16 Jan 2008 14:42 GMT
Thanks I'll give it a try
> Sorry should have used INTERSECT method:
>
[quoted text clipped - 62 lines]
> > > > > > range, nothing happens. What am I doing wrong here?
> > > > > > Thanks
Mike H - 16 Jan 2008 14:56 GMT
will this doit
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Cells.Count > 1 Or IsEmpty(Target) Then Exit Sub
If Not Intersect(Target, Range("drw1inforng")) Is Nothing Then
MsgBox Target.Value
End If
End Sub
Mike
> I am looking for a way to run a macro when a cell in a range is changed. I
> used the code that you suggested and each time a cell is changed, it goes
[quoted text clipped - 38 lines]
> > > range, nothing happens. What am I doing wrong here?
> > > Thanks