RockandGrohl
Well-known Member
- Joined
- Aug 1, 2018
- Messages
- 810
- Office Version
- 365
- Platform
- Windows
Hi all, I'm trying to record a sumif with 6 different criteria pointing at different workbooks, when I record it, it seems to cut it after a point and replace a bunch of it with a " _ & "
As a result, I think I fixed it with this but I still get application or object defined error:
Just to note, the formula above it which is just too short to get chopped up works fine:
And if I put that formula in the space for troubled line of code, it works fine (so it's not a problem with the activecell.offset part of the code)
Any ideas? Thanks.
As a result, I think I fixed it with this but I still get application or object defined error:
Code:
Range(Cells(arow, ActiveCell.Offset(0, 1).Column), Cells(respend, ActiveCell.Offset(0, 1).Column)).FormulaR1C1 = "=SUMIFS('[Faculty Reporting Master.xlsm]Booking Data'!C6,'[Faculty Reporting Master.xlsm]Booking Data'!C13,""Y"",'[Faculty Reporting Master.xlsm]Booking Data'!C14,""Y"",'[Faculty Reporting Master.xlsm]Booking Data'!C17,""Y"",'[Faculty Reporting Master.xlsm]Booking Data'!C9,"">=""&DATE(RC1,RC2,1),'[Faculty Reporting Master.xlsm]Booking Data'!C9,""<=""&EOMONTH(DATE(RC1,RC2,1)0),'[Faculty Reporting Master.xlsm]Booking Data'!C21,R2C[-1])"
Just to note, the formula above it which is just too short to get chopped up works fine:
Code:
Range(Cells(arow, ActiveCell.Column), Cells(respend, ActiveCell.Column)).FormulaR1C1 = "=COUNTIFS('[Faculty Reporting Master.xlsm]Booking Data'!C13,""Y"",'[Faculty Reporting Master.xlsm]Booking Data'!C14,""Y"",'[Faculty Reporting Master.xlsm]Booking Data'!C17,""Y"",'[Faculty Reporting Master.xlsm]Booking Data'!C9,"">=""&DATE(RC1,RC2,1),'[Faculty Reporting Master.xlsm]Booking Data'!C9,""<=""&EOMONTH(DATE(RC1,RC2,1),0),'[Faculty Reporting Master.xlsm]Booking Data'!C21,R2C)"
And if I put that formula in the space for troubled line of code, it works fine (so it's not a problem with the activecell.offset part of the code)
Any ideas? Thanks.