UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> Target, Office 2007    
 
   
mjschukas
post Apr 17 2012, 05:55 PM
Post #1

UtterAccess Ruler
Posts: 1,382



i was looking for an example/understanding for using the range reference Target...?

???

thank you.
Go to the top of the page
 
+
ipisors
post Apr 17 2012, 05:56 PM
Post #2

UtterAccess Certified!
Posts: 7,189
From: Arizona, United States



Well, here is an example at least. If you want to trigger code that watches for cell A2 to change, then you can place this code in the Worksheet_Change event of the worksheet:

CODE
Private Sub Worksheet_Change(ByVal Target As Range)

If Target = Range("A1") Then
    MsgBox "Hi, you just changed cell A1"
End If

End Sub
Go to the top of the page
 
+
norie
post Apr 17 2012, 06:45 PM
Post #3

UtterAccess VIP
Posts: 4,308



Target is an argument passed to event code, eg Worksheet_Change, that is a reference to the range that's been changed/selected.

You can use it in the rest of the code.

Go to the top of the page
 
+
mjschukas
post Apr 18 2012, 01:43 PM
Post #4

UtterAccess Ruler
Posts: 1,382



thank you....

and this example on ozgrid helped:

Private Sub Worksheet_Change(ByVal Target As Range)

If Not Intersect(Target, Range("A1:A10")) Is Nothing Then

MsgBox "Hello"

End If

End Sub

thank you...!
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th June 2013 - 07:48 PM