intersection with multiple ranges

  • Thread starter Thread starter pburk
  • Start date Start date
P

pburk

I am need of some help. I got the script to use an intersection to call a
macro for certain conditions. I have multiple pull downs, 1 being at e12.
based on the pull down selection (o29) then a macro is called. My form has
18 pull downs. if a particular item is selected in the pull down then the
macro executes.

Set t = Target
Set a = Range("e12")
Set aa = Range("o29")
If Intersect(t, a) Is Nothing Then Exit Sub
Cancel = True
If aa.Value = 3 Then idc4_pick

I need to match or intersect e12/029, f12/p29, etc.
Is this a possibility or is it wishful thinking?
thank you in advance for any input.
 
It's difficult to follow your objective
I need to match or intersect e12/029, f12/p29, etc.

Do you mean intersect(range("e12:o29"), range("f12:p29"))

or do you mean

Intersect(t, a, aa, etc)

or something else?

Regards,
Peter T
 
Set Target = ActiveCell
Set a = Range("E12")
Set aa = Range("O29")
If Intersect(Target, Union(a, aa)) Is Nothing Then Exit Sub
Cancel = True
If aa.Value = 3 Then idc4_pick
 
thank you for responding.
My form has multiple Excel pull down lists which store reference values in
cells o29, p29, q29 etc. When the user selects a certain item within that
pull down list a user form activates. that part is working fine.
What I am trying to set up is : if cell o29 is "3" (selection item from
drop down list) and user double clicks e12 then that user form re-activates.
that is where the match comes in o29/e12, p29/f12, etc.

Input is appreciated.
 
thank you for the response. This coding worked for the first instance
e12/o29. When I add additional cell references, acts like a cell edit mode.
My additional explanation to Peter might assist in my explanation of what
I'm trying to set up.
 
this is what i have modified. double click on cell f12 goes to a cell edit
mode.

Set Target = ActiveCell
Set a = Range("e12")
Set b = Range("f12")
Set aa = Range("o29")
Set ab = Range("p29")
If Intersect(Target, Union(a, aa)) Is Nothing Then Exit Sub
Cancel = True
If aa.Value = 3 Then idc4_pick
If Intersect(Target, Union(b, ab)) Is Nothing Then Exit Sub
Cancel = True
If ab.Value = 3 Then idc5_pick
 
I'm sorry but I really don't follow what you are trying to do. Try and
describe an example with known ranges you start with and the range you want
returned from the Intersect.

Regards,
Peter T
 
Back
Top