SumProduct for select to the last cell that contains data???

M

mniccole

Hi:
How would I change the formula below to go only the last row that
contains data instead of setting a static range?
Please help
Thanks


Worksheets("Menu").Range("C18").Formula =
"=SUMPRODUCT((BillingHoldDetails!M2:M3000)*(BillingHoldDetails!$A$2:$A$3000=""AP
BILLING""))"
 
B

Bob Phillips

Worksheets("Menu").Range("C18").Formula = _
"=SUMIF(BillingHoldDetails!$A:$A,""AP
BILLING"",BillingHoldDetails!$M:$M)"

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 
M

mniccole

Thanks Bob...
Works perfect.

Bob said:
Worksheets("Menu").Range("C18").Formula = _
"=SUMIF(BillingHoldDetails!$A:$A,""AP
BILLING"",BillingHoldDetails!$M:$M)"

--
---
HTH

Bob

(change the xxxx to gmail if mailing direct)
 
M

mniccole

HI:
Can you tell me how to loop to the end of the data range without this
being static?
Please

numrows = Range("A2", Range("A2").End(xlDown)).Rows.Count
Range("A2").EntireColumn.Select

For x = 1 To 3000

Thanks so much
 
Top