HI everyone!
I am trying to consolidate data from two columns next to each other for a macro. When I recorded the macro, it gave me this code in VBA:
Selection.Consolidate Sources:= _
"'C:\Users\random\Desktop\[DensityTest.csv]DensityTest'!R2C2:R823C3", _
Function:=xlSum, TopRow:=True, LeftColumn:=True, CreateLinks:=False
However when I try to run this macro on a different spreadsheet, it will consolidate the data from this original worksheet and not the new one. Is there VBA code I can use to replace these lines so that I can consolidate the columns in a new worksheet?
Thanks so much!
I am trying to consolidate data from two columns next to each other for a macro. When I recorded the macro, it gave me this code in VBA:
Selection.Consolidate Sources:= _
"'C:\Users\random\Desktop\[DensityTest.csv]DensityTest'!R2C2:R823C3", _
Function:=xlSum, TopRow:=True, LeftColumn:=True, CreateLinks:=False
However when I try to run this macro on a different spreadsheet, it will consolidate the data from this original worksheet and not the new one. Is there VBA code I can use to replace these lines so that I can consolidate the columns in a new worksheet?
Thanks so much!