Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How do you use If Target.Address = _____ Then for more than one cells.
The cells I want are F67 Or F73 Or F79 Or F85 Or F91 Or F97 Or F103 Or F109 Or F115 Or F121 Or F127 Or F133 Or F139 Or F145 Thanks for your help in advance. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub dural()
Set r = Range("F67,F73,F79,F85,F91,F97,F103,F109,F115,F121 ,F127,F133,F139,F145") MsgBox (r.Address) Set Target = ActiveCell If Intersect(Target, r) Is Nothing Then ' do something Else 'do something else End If End Sub -- Gary''s Student - gsnu200846 "Leiprecht" wrote: How do you use If Target.Address = _____ Then for more than one cells. The cells I want are F67 Or F73 Or F79 Or F85 Or F91 Or F97 Or F103 Or F109 Or F115 Or F121 Or F127 Or F133 Or F139 Or F145 Thanks for your help in advance. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi
Look at this: Set TestRange = Range _ ("F67 , F73, F79, F85, F91, F97, F103, F109, F115, F121, F127, F133, F139, F145") Set isect = Intersect(Target, TestRange) If Not isect Is Nothing Then MsgBox ("Target intersect with TestRange") End If Hopes this helps --- Per "Leiprecht" skrev i meddelelsen ... How do you use If Target.Address = _____ Then for more than one cells. The cells I want are F67 Or F73 Or F79 Or F85 Or F91 Or F97 Or F103 Or F109 Or F115 Or F121 Or F127 Or F133 Or F139 Or F145 Thanks for your help in advance. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Given the regularity of your ranges (they all differ by 6), you can use this
mathematical relationship to test if the Target row is within your range... If Abs(Target.Row - 106) <= 39 And ((Target.Row - 67) Mod 6 = 0) Then -- Rick (MVP - Excel) "Leiprecht" wrote in message ... How do you use If Target.Address = _____ Then for more than one cells. The cells I want are F67 Or F73 Or F79 Or F85 Or F91 Or F97 Or F103 Or F109 Or F115 Or F121 Or F127 Or F133 Or F139 Or F145 Thanks for your help in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Can you use a Range $N$xx:$Q$xx in Target.Address? | Excel Programming | |||
UCase with Worksheet_Change and Target Address | Excel Programming | |||
Using Target.Address in Excel 98 | Excel Discussion (Misc queries) | |||
Target.Address syntax | Excel Worksheet Functions | |||
target address | Excel Programming |