Private Sub Worksheet_Change(ByVal Target As Excel.Range)

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Address = "$D$11" Then
MsgBox “Sellâ€
End If
End Sub

Is there a way to stipulate multiple target addresses?
"$D$11" Or “$G$11†Then... does not work.
 
Try something like the following:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1,B2,C3")) _
Is Nothing Then
MsgBox "Sell"
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Thank You Chip,
Arturo

Chip Pearson said:
Try something like the following:

Private Sub Worksheet_Change(ByVal Target As Range)
If Not Application.Intersect(Target, Range("A1,B2,C3")) _
Is Nothing Then
MsgBox "Sell"
End If
End Sub


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Hi Arturo,

You could just use an Orm but I use the Intersect method

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("D11,G11")) Is Nothing Then
MsgBox "Sell"
End If
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
Thank You Bob,
Arturo

Bob Phillips said:
Hi Arturo,

You could just use an Orm but I use the Intersect method

Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Not Intersect(Target, Range("D11,G11")) Is Nothing Then
MsgBox "Sell"
End If
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)
 
new to this is there a way to use data in a cell ( have one column with pull
down menu that change entry in that cell with validation) plus other data in
row combined to trigger event. I have multiple worksheets in workbook. Trying
to have data from first worksheet copied to other as needed. Have suceeded in
doing one. Not sure of useing multiple cells in row to do job. most data is
text.
Seen this in search
If target .address said:
Is Nothing Then (this is yous) _
call procedure
Would I use target range to call procedure I want to run?
A little direction would be appreciated
Going back to try
Thanks
 
Back
Top