Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 9,101
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 469
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to trigger MsgBox for this event? TimN Excel Programming 3 September 1st 06 05:11 PM
Event trigger in Excel? Tim Miller Excel Programming 1 May 24th 06 09:02 PM
Event Trigger lobo Excel Programming 5 December 16th 05 08:33 PM
Trigger Event Todd Huttenstine Excel Programming 2 July 14th 04 06:50 PM


All times are GMT +1. The time now is 05:25 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"