kanishkgarg
New Member
- Joined
- Sep 29, 2021
- Messages
- 21
- Office Version
- 365
- Platform
- Windows
Hi,
I need to enter a SUMIF function in my vba code and then paste it throughout the column. There are two worksheets - s1 and s2.
This is the formula I have come up with but it is not working:
Furthermore, I also need to paste it throughout the column till a specific point (which is determined by the number of cells with data in the adjacent column). -
Any help would be greatly appreciated!
I need to enter a SUMIF function in my vba code and then paste it throughout the column. There are two worksheets - s1 and s2.
This is the formula I have come up with but it is not working:
VBA Code:
s2.Range("B3").Formula2R1C1 = "=SUMIF( " & s1.Name &!R3C5:R50000C5, s2.Name!R3C1 . Offset ( ,-1), s1.Name !R3C20:R50000C20 & ")"
Furthermore, I also need to paste it throughout the column till a specific point (which is determined by the number of cells with data in the adjacent column). -
VBA Code:
'Selection.AutoFill Destination:=Range("B3:B" & Range("A" & Rows.Count).End(xlUp).Row)
'Range(Selection, Selection.End(xlDown)).Select
Any help would be greatly appreciated!