ianawwalker
New Member
- Joined
- Feb 16, 2023
- Messages
- 15
- Office Version
- 365
- 2021
- Platform
- Windows
Hello,
I have this formula that I want to have filled down to the last row in column A, which could go down 20-30K rows. The VBA I am currently using is only pasting within row 2 of each of the columns and i can't figure out why. Any help would be greatly appreciated.
With Sheets("US_Combine")
.Range("C2:C" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
.Range("D2:D" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
.Range("E2:E" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
.Range("F2:F" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
End With
Thank you,
Ian
I have this formula that I want to have filled down to the last row in column A, which could go down 20-30K rows. The VBA I am currently using is only pasting within row 2 of each of the columns and i can't figure out why. Any help would be greatly appreciated.
With Sheets("US_Combine")
.Range("C2:C" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
.Range("D2:D" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
.Range("E2:E" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
.Range("F2:F" & Cells(Rows.Count, 3).End(xlUp).Row).Formula2R1C1 = _
"=SUM(COUNTIFS(US_Exceptions!C1,US_Combine!RC1,US_Exceptions!C2,INDEX(US_Codes!R2C[-1]:R11C[-1],0)))"
End With
Thank you,
Ian