What is the correct syntax if I want to replace two named ranges below to Rng and Rng2 in my code? Thanks!
![]()
If Not Intersect(Target, Range("F17:F116,K17:K116")) Is Nothing Then
What is the correct syntax if I want to replace two named ranges below to Rng and Rng2 in my code? Thanks!
![]()
If Not Intersect(Target, Range("F17:F116,K17:K116")) Is Nothing Then
Last edited by jman0707; 11-24-2008 at 05:24 PM.
![]()
If Not Intersect(Rng1, Rng2) Is Nothing Then
Entia non sunt multiplicanda sine necessitate
Thanks shg! Target needs to be in there somewhere as well though. So right now if the target either intersects F17:F116 OR K17:K116, then it runs. So can I put
Or will that only run if they all 3 intersect (which can't happen)?![]()
If Not Intersect(Target, Rng1, Rng2) Is Nothing Then
Hello Jman0707,
All the range arguments in the Application.Intersect function have to share at least one or more cells in common for a range to be returned that represents the cells that overlap. Since Rng1 and Rng2 are fixed, target, which can vary, will determine the result.
Sincerely,![]()
If Not Intersect(Target, Rng1, Rng2) Is Nothing Then
Leith Ross
To test if Target is in Rng1 or Rng2 (or both),
![]()
If Not Intersect(Target, Union(Rng1, Rng2) ) Is Nothing Then
Last edited by shg; 11-24-2008 at 04:26 PM.
OK. I got it to work with the union formula. Thanks!
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks