Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open event trigger
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 |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open event trigger
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 "Curt" wrote: 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 |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open event trigger
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 "Joel" wrote: 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 "Curt" wrote: 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 |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open event trigger
See Answers below
"Curt" wrote: 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 "Joel" wrote: 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 "Curt" wrote: 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 |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Open event trigger
Thanks much You have helped greatly
Thanks again "Joel" wrote: See Answers below "Curt" wrote: 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 "Joel" wrote: 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 "Curt" wrote: 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 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
How to trigger MsgBox for this event? | Excel Programming | |||
Event trigger in Excel? | Excel Programming | |||
Event Trigger | Excel Programming | |||
Trigger Event | Excel Programming |