NileshAPatel
New Member
- Joined
- May 29, 2021
- Messages
- 26
- Office Version
- 365
- 2019
- Platform
- Windows
HI
Please help to resolve error in below code
Wants to please sum formula in Cell E163 by selecting E6 to E162, but condition is to sum only those figure if corresponding cell in column D in not empty
Sub MM1()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
ActiveCell.Formula2R1C1 = _
"=SUMPRODUCT((R6C4:R&lrC4="""")* SUBTOTAL(109, OFFSET(R&[-lr]C, ROW(R&[-lr]C:R[-1]C)- ROW(R&[-lr]C),)))"
Range("E164").Select
End Sub
Thanks !!
Please help to resolve error in below code
Wants to please sum formula in Cell E163 by selecting E6 to E162, but condition is to sum only those figure if corresponding cell in column D in not empty
Sub MM1()
Dim lr As Long, r As Long
lr = Cells(Rows.Count, "A").End(xlUp).Row
ActiveCell.Formula2R1C1 = _
"=SUMPRODUCT((R6C4:R&lrC4="""")* SUBTOTAL(109, OFFSET(R&[-lr]C, ROW(R&[-lr]C:R[-1]C)- ROW(R&[-lr]C),)))"
Range("E164").Select
End Sub
Thanks !!