Home |
Search |
Today's Posts |
#1
![]() |
|||
|
|||
![]()
Here's the situation: I have a worksheet that will have an "X" in
either cell F3 or G3 or H3. What I would like to do (via a macro), is to examine F3, G3 and H3, and if there is an "X" in anyone of those cells, to run another specific macro. For example: Run a macro (for example called "totalsummary")to determine... If there is an "X" in F3, then run a macro called "summaryEL"; If there is an "X" in G3, then run a macro called "summaryHT"; If there is an "X" in H3, then run a macro called "summaryFA". This has to be a macro that starts this process, rather than an if statement, as I wish to control when this process will happen seperate from the condition. In other words, the macro that I run will have if statements imbedded, and if anyone one of those if statements are true (as it will be only one), the result is antoher seperate macro running. Is this a long way of doing this, or is there a better way. Thanks in advance. Pete |
#2
![]() |
|||
|
|||
![]()
Hi
one way: '.... with activesheet.range("F3") if .value="X" then summaryEL elseif .offset(0,1).value)="X" then summaryHT elseif .offset(0,2).value)="X" then summaryFA end if end with '... -- Regards Frank Kabel Frankfurt, Germany "SATB" schrieb im Newsbeitrag m... Here's the situation: I have a worksheet that will have an "X" in either cell F3 or G3 or H3. What I would like to do (via a macro), is to examine F3, G3 and H3, and if there is an "X" in anyone of those cells, to run another specific macro. For example: Run a macro (for example called "totalsummary")to determine... If there is an "X" in F3, then run a macro called "summaryEL"; If there is an "X" in G3, then run a macro called "summaryHT"; If there is an "X" in H3, then run a macro called "summaryFA". This has to be a macro that starts this process, rather than an if statement, as I wish to control when this process will happen seperate from the condition. In other words, the macro that I run will have if statements imbedded, and if anyone one of those if statements are true (as it will be only one), the result is antoher seperate macro running. Is this a long way of doing this, or is there a better way. Thanks in advance. Pete |
#3
![]() |
|||
|
|||
![]()
Frank: Thanks very much for your suggestion...however there was a
slight error when it went to the "elseif.offset(0,1).value..." statement. I modified the macro as follows, and it worked great... Sub summary() ' With ActiveSheet.Range("F3") If .Value = "X" Then summaryEL ElseIf ActiveSheet.Range("G3") = "X" Then summaryHT ElseIf ActiveSheet.Range("H3") = "X" Then summaryFA End If End With End Sub Again, thanks for your help. Pete "Frank Kabel" wrote in message ... Hi one way: '.... with activesheet.range("F3") if .value="X" then summaryEL elseif .offset(0,1).value)="X" then summaryHT elseif .offset(0,2).value)="X" then summaryFA end if end with '... -- Regards Frank Kabel Frankfurt, Germany "SATB" schrieb im Newsbeitrag m... Here's the situation: I have a worksheet that will have an "X" in either cell F3 or G3 or H3. What I would like to do (via a macro), is to examine F3, G3 and H3, and if there is an "X" in anyone of those cells, to run another specific macro. For example: Run a macro (for example called "totalsummary")to determine... If there is an "X" in F3, then run a macro called "summaryEL"; If there is an "X" in G3, then run a macro called "summaryHT"; If there is an "X" in H3, then run a macro called "summaryFA". This has to be a macro that starts this process, rather than an if statement, as I wish to control when this process will happen seperate from the condition. In other words, the macro that I run will have if statements imbedded, and if anyone one of those if statements are true (as it will be only one), the result is antoher seperate macro running. Is this a long way of doing this, or is there a better way. Thanks in advance. Pete |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Macro help | Excel Discussion (Misc queries) | |||
macro - adding rows to a column that is summed | Excel Discussion (Misc queries) | |||
Date and Time Macro | Excel Discussion (Misc queries) | |||
macro interruption: help!!! | Excel Discussion (Misc queries) | |||
Macro for Show/Hide Column | Excel Discussion (Misc queries) |