Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello-
I have a module that will combine two workbooks, calculate certain cells, then email the summary information to a group of individuals on our management team. Cell D5 is formatted as a percentage and I want to send to a specific group based on the value of the cell. I have two modules, SendStats (mid managers), and SendStats1 (mid managers and upper management) used to determine which group will be emailed. If cell D5 is greater than 3%, I want to call module SendStats1, otherwise I want to call module SendStats. I tried an IF statement in VBA, but could not get it to work right. Can someone help? Thanks- Scott |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
if workbooks("someworkbookname") _
.worksheets("someworksheetname").range("d5").value .03 then call sendstats1 else call sendstats end if I bet you meant you had two procedures named SendStats and Sendstats1--not modules. If the module names were really SendStats and SendStats1, then you'll have to change the "call" statements in the code to match the subroutine names. And don't give the procedures and modules the same name. It can confuse excel really bad. Scott wrote: Hello- I have a module that will combine two workbooks, calculate certain cells, then email the summary information to a group of individuals on our management team. Cell D5 is formatted as a percentage and I want to send to a specific group based on the value of the cell. I have two modules, SendStats (mid managers), and SendStats1 (mid managers and upper management) used to determine which group will be emailed. If cell D5 is greater than 3%, I want to call module SendStats1, otherwise I want to call module SendStats. I tried an IF statement in VBA, but could not get it to work right. Can someone help? Thanks- Scott -- Dave Peterson |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 18, 5:40 pm, Dave Peterson wrote:
if workbooks("someworkbookname") _ .worksheets("someworksheetname").range("d5").value .03 then call sendstats1 else call sendstats end if I bet you meant you had two procedures named SendStats and Sendstats1--not modules. If the module names were really SendStats and SendStats1, then you'll have to change the "call" statements in the code to match the subroutine names. And don't give the procedures and modules the same name. It can confuse excel really bad. Scott wrote: Hello- I have a module that will combine two workbooks, calculate certain cells, then email the summary information to a group of individuals on our management team. Cell D5 is formatted as a percentage and I want to send to a specific group based on the value of the cell. I have two modules, SendStats (mid managers), and SendStats1 (mid managers and upper management) used to determine which group will be emailed. If cell D5 is greater than 3%, I want to call module SendStats1, otherwise I want to call module SendStats. I tried an IF statement in VBA, but could not get it to work right. Can someone help? Thanks- Scott -- Dave Peterson- Hide quoted text - - Show quoted text - Worked great, thanks Dave! |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
using an if then statement call a caption box to a cell | Excel Programming | |||
using an if then statement call a caption box to a cell | Excel Programming | |||
using an if then statement call a caption box to a cell | Excel Programming | |||
Call a macro or sub based on the name of a cell? | Excel Programming | |||
Call a macro or sub based on the name of a cell? | Excel Programming |