Open event trigger

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Is there a way to have multiple cell values checked befor triggering event.
Need to qualify 3 or 4 cells if possible. So far no luck. Whenever I try a
second qualifer it wont trigger.
This could be a befor close also I guess have never tried that. Think it
would do the same.
Any direction will be appreciated
Thanks
 
Are you using worksheet_change Event? there is only 1 parameter. Check the
Target input parameter and only do your checking when the routine is called
from the proper cell

You can do something like this

if (Target.Row = 3) and (Target.Column 5) then

'perform needed checks
' can check any cells on the worksheet even if they arre not part of
target
if Worksheets("Sheet1").Range("A7") = 0 then
a = 5
else
if Worksheets("Sheet1").Range("A9") = 0 then
a = 6
end if
end if
end if
 
If target.Column = 12 And target.Value > 10 And IsNumeric(target.Value) Then _
Call CopyDonors(target)
If target.Column = (10) And target.Value <> phNbr Then _
If target.Column = (12) And target.Value <= 0 Then _
Call Copycomp(target)
' End Select
This is a workbook event can we have data create the parameter to call the
procedure? Used nested ifs once in a worksheet. Is there a way to use them in
VBA? All actions are based on entry in rows. CopyDonors works fine as last
entry in row triggers. Is it possible to have row change trigger?
Thanks for looking your help is greatly appreciated
 
See Answers below

:

If target.Column = 12 And target.Value > 10 And IsNumeric(target.Value)
Then _
Call CopyDonors(target)
If target.Column = (10) And target.Value <> phNbr Then _
If target.Column = (12) And target.Value <= 0 Then _
Call Copycomp(target)
' End Select


1) This is a workbook event can we have data create the parameter to call the
procedure?

Each event has a different set of parameters that cannot be changed. Since
you didn't tell me which event is being used I cannot tell you the parameters.

2) Used nested ifs once in a worksheet. Is there a way to use them in
VBA?

VBA accepts nested If. If the IF is one one line then no "end if" is
necessary. If is on multiple line then each if must have an "end if"

If a > b then

if c > d then

z = 5
else

x = 7
end if

end if



3) All actions are based on entry in rows. CopyDonors works fine as last
entry in row triggers. Is it possible to have row change trigger?

Yes Yes Yes. If you are using the Worksheet_Change event and you add a row
the event gets called for the entire row and then again for ever cell in the
row. When the row gets called the TARGET range is $1:$1 for row one. Then
gets called for each cell with TARGET = $A$1

Thanks for looking your help is greatly appreciated
 
Thanks much You have helped greatly
Thanks again

Joel said:
See Answers below

:

If target.Column = 12 And target.Value > 10 And IsNumeric(target.Value)
Then _
Call CopyDonors(target)
If target.Column = (10) And target.Value <> phNbr Then _
If target.Column = (12) And target.Value <= 0 Then _
Call Copycomp(target)
' End Select


1) This is a workbook event can we have data create the parameter to call the
procedure?

Each event has a different set of parameters that cannot be changed. Since
you didn't tell me which event is being used I cannot tell you the parameters.

2) Used nested ifs once in a worksheet. Is there a way to use them in
VBA?

VBA accepts nested If. If the IF is one one line then no "end if" is
necessary. If is on multiple line then each if must have an "end if"

If a > b then

if c > d then

z = 5
else

x = 7
end if

end if



3) All actions are based on entry in rows. CopyDonors works fine as last
entry in row triggers. Is it possible to have row change trigger?

Yes Yes Yes. If you are using the Worksheet_Change event and you add a row
the event gets called for the entire row and then again for ever cell in the
row. When the row gets called the TARGET range is $1:$1 for row one. Then
gets called for each cell with TARGET = $A$1

Thanks for looking your help is greatly appreciated
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top