I am currently struggling to find a code that will allow my macro to function properly when opening a new workbook form my excel template. The issue im having is that the consolidate function I am using is referencing the template file and not the new workbook-where the new info will be input. Below is the code, I would need the red area to be dynamic and change per new workbook name, the sheet in the workbook will be the same name so "New Data" shouldnt be an issue. Thanks
Range("A4").Select
Selection.Consolidate Sources:= _
"'G:\Interns\Aevin Sanjay\[Model Template Update.xltm]New Data'!R5C5:R203C7", _
Function:=xlSum, TopRow:=False, LeftColumn:=True, CreateLinks:=False
ActiveWindow.SmallScroll Down:=0
Range("H4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Admin 2").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Range("A4").Select
Selection.Consolidate Sources:= _
"'G:\Interns\Aevin Sanjay\[Model Template Update.xltm]New Data'!R5C5:R203C7", _
Function:=xlSum, TopRow:=False, LeftColumn:=True, CreateLinks:=False
ActiveWindow.SmallScroll Down:=0
Range("H4").Select
Range(Selection, Selection.End(xlDown)).Select
Selection.Copy
Sheets("Admin 2").Select
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False