airforceone
Board Regular
- Joined
- Feb 14, 2022
- Messages
- 201
- Office Version
- 2019
- 2016
- Platform
- Windows
hi again,
I'm using set of VBA but does not compute the range properly! what seems to be the problem? i shall implement it in a loop sequence but the second computation is a bit off
I'm using set of VBA but does not compute the range properly! what seems to be the problem? i shall implement it in a loop sequence but the second computation is a bit off
VBA Code:
Range("A2:M" & LastRow).AutoFilter 1, "=" & "*DAMAGE TO PROPERTY"
Range("B10") = WorksheetFunction.Subtotal(9, Range("B2:B14"))
Range("C10") = WorksheetFunction.Subtotal(9, Range("C2:C14"))
Range("D10") = WorksheetFunction.Subtotal(9, Range("D2:D14"))
Range("B1").AutoFilter 'Turn autofilter Off
XXXXXXXXXXXXXX UCPER DATA.xls | ||||||
---|---|---|---|---|---|---|
A | B | C | D | |||
1 | PARTICULAR | RURAL | URBAN | CITY | ||
2 | PORCH | 8 | ||||
3 | VERANDA | 8 | ||||
4 | ROOF | 1 | ||||
5 | DAMAGE TO PROPERTY | 6 | 3 | 1 | ||
6 | MULTIPLE DAMAGE TO PROPERTY | 0 | 2 | |||
7 | REPAIRED | 3 | 2 | |||
8 | SOLD | 1 | 1 | |||
TEST_MERGE (7) |