Oberon70
Board Regular
- Joined
- Jan 21, 2022
- Messages
- 160
- Office Version
- 365
- Platform
- Windows
I am trying to figure out how to code VBA to consolidate a range on one of my sheets.
The sheet would have the following on it:
and once consolidated it would look like (not consolidating the 7101)
The size of the above data can be different from each report, but it is always A1:D and then lRow is my variable that the number of rows are assigned to.
I came across the website with information on consolidating.
Consolidated Data Link
and thought I ad to convert my range address to R1C1 and found the below:
Msgbox Application.ConvertFormula(Formula:="A2:" & "D" & lRow, FromReferenceStyle:=xlA1, ToReferenceStyle:=xlR1C1)
However, I don't know how I take this part Application.ConvertFormula(Formula:="A2:" & "D" & lRow, FromReferenceStyle:=xlA1, ToReferenceStyle:=xlR1C1) and assign it to a variable
or if there is a better way to accomplish the above?
The sheet would have the following on it:
and once consolidated it would look like (not consolidating the 7101)
The size of the above data can be different from each report, but it is always A1:D and then lRow is my variable that the number of rows are assigned to.
I came across the website with information on consolidating.
Consolidated Data Link
and thought I ad to convert my range address to R1C1 and found the below:
Msgbox Application.ConvertFormula(Formula:="A2:" & "D" & lRow, FromReferenceStyle:=xlA1, ToReferenceStyle:=xlR1C1)
However, I don't know how I take this part Application.ConvertFormula(Formula:="A2:" & "D" & lRow, FromReferenceStyle:=xlA1, ToReferenceStyle:=xlR1C1) and assign it to a variable
or if there is a better way to accomplish the above?