Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed to write a "SUMIF" formula in VBA
I am using Excel 2000 and I have a question regarding a "sumif" formula. I
use a wookbook to calculate petty cash purchases daily with a table with all the calculations on sheet1. I wish to change the calculations to VBA to stop any corruption of sheet1 which I have done apart from the formula +sumif(E9:E16,"TH",B9:B16) the "TH" being an employee's initials. I would like to change "TH" to a cell reference that being sheet2.range("B2") if that is possible so that the formula would be equivalent to +sumif(E9:E16,"SHEET2.RANGE("B2")",B9:B16) in VBA many thanks in advance regards JIM BROOKS |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Help needed to write a "SUMIF" formula in VBA
WorksheetFunction.SumIf(Worksheets("Sheet2").[E9:E16],
Worksheets("Sheet2").[B2], Worksheets("Sheet2").[B9:B16]) Jerry JIMBROOKS wrote: I am using Excel 2000 and I have a question regarding a "sumif" formula. I use a wookbook to calculate petty cash purchases daily with a table with all the calculations on sheet1. I wish to change the calculations to VBA to stop any corruption of sheet1 which I have done apart from the formula +sumif(E9:E16,"TH",B9:B16) the "TH" being an employee's initials. I would like to change "TH" to a cell reference that being sheet2.range("B2") if that is possible so that the formula would be equivalent to +sumif(E9:E16,"SHEET2.RANGE("B2")",B9:B16) in VBA many thanks in advance regards JIM BROOKS |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how to write formula for countif (range,"<2" &"3") | Excel Discussion (Misc queries) | |||
How do I write an excel formula with a text answer ("yes" or "no") | Excel Discussion (Misc queries) | |||
Sumif formula that uses "contains" rather than "equals" | Excel Discussion (Misc queries) | |||
help needed on "sumif function with multiple ifs" | Excel Discussion (Misc queries) | |||
Using "Cells" to write "Range("A:A,H:H").Select" | Excel Programming |