Hello
I'm new to using anything beyond simple copy paste functions in VBA. I want to do a sumif calculation using VBA where the output is values pasted in a defined range.
The goal is to copy a values in range with a fixed set of dates to another range which has more dates but have those values align with the column in which their original dates.
<tbody>
</tbody>
The code I am using is in the latest excel :
I am new to this syntax on what is required to adapt this, if you could please show me how to make this work that would be amazing.
Thank you
X
I'm new to using anything beyond simple copy paste functions in VBA. I want to do a sumif calculation using VBA where the output is values pasted in a defined range.
The goal is to copy a values in range with a fixed set of dates to another range which has more dates but have those values align with the column in which their original dates.
31-Jan-18 | 28-Feb-18 | 31-Mar-18 | 30-Apr-18 | 31-May-18 | DatePaste | |
1 | 2 | 3 | RangePaste | |||
31-Jan-18 | 28-Feb-18 | 30-Apr-18 | DateCopy | |||
1 | 2 | 3 | ValuesCopy |
<tbody>
</tbody>
The code I am using is in the latest excel :
Code:
Sub SumIFPaste()
Dim RangePaste As Range
Dim Datecopy As Range
Dim DatePaste As Variant
Dim ValuesCopy As Range
RangePaste = Application.WorksheetFunction.SumIf(Datecopy, DatePaste, ValuesCopy)
End Sub
Thank you
X