ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Private Sub Worksheet_SelectionChange(ByVal Target As Range) (https://www.excelbanter.com/excel-programming/320319-private-sub-worksheet_selectionchange-byval-target-range.html)

Arturo

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 
Cell F9 has a validation list associated with it.
Is there a way to specify Worksheet_SelectionChange firing only if cell F9
changes?
Am not readily finding detail on (ByVal Target As Range)
Thanks,
Arturo

Bob Phillips[_6_]

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 
Private Sub Worksheet_SelectionChange(ByVal Target As Range)

If Target.Address = "$F$9" Then
With Target
'do your stuff
End With
End If
End Sub


--

HTH

RP
(remove nothere from the email address if mailing direct)


"Arturo" wrote in message
...
Cell F9 has a validation list associated with it.
Is there a way to specify Worksheet_SelectionChange firing only if cell F9
changes?
Am not readily finding detail on (ByVal Target As Range)
Thanks,
Arturo




Tom Ogilvy

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
 
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = $F$9" then
' your code
End if
End Sub

Note this is the change event, not the selectionchange event.

http://www.cpearson.com/excel/events.htm

Chip Pearson's page on events.

--
Regards,
Tom Ogilvy


"Arturo" wrote in message
...
Cell F9 has a validation list associated with it.
Is there a way to specify Worksheet_SelectionChange firing only if cell F9
changes?
Am not readily finding detail on (ByVal Target As Range)
Thanks,
Arturo





All times are GMT +1. The time now is 09:10 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com