how about naming the workbook when its opened so you can refer to it by a specific name
Not sure I understand. I dont work much in VB.
Below is sample code on one of my macros
Sub AGING_FORMAT()
'
' AGING_FORMAT Macro
'
'
Columns("A:A").Select
Selection.Delete Shift:=xlToLeft
Columns("D:G").Select
Selection.Delete Shift:=xlToLeft
Columns("A:L").Select
Columns("A:L").EntireColumn.AutoFit
Range("B2").Select
Columns("B:B").ColumnWidth = 26.22
Range("C1").Select
ActiveCell.FormulaR1C1 = "Parent"
Range("C2").Select
Columns("C:C").ColumnWidth = 4.33
Columns("C:C").ColumnWidth = 4.44
Columns("C:C").EntireColumn.AutoFit
Columns("C:C").ColumnWidth = 17.11
Workbooks.Open Filename:= _
"X:\Finance_Dept\Accts_Receivable\Aging Reports\Accounts By Collector.xlsx"
Windows("aging.xls").Activate
Selection.FormulaR1C1 = _
"=VLOOKUP(RC[-2],'[Accounts By Collector.xlsx]aging'!R2C1:R5301C5,5,0)"
Selection.Copy
Range("B2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveWindow.SmallScroll Down:=-12
Application.CutCopyMode = False
Selection.FormulaR1C1 = _
"=VLOOKUP(RC[-2],'[Accounts By Collector.xlsx]aging'!R2C1:R5301C3,3,0)"
Selection.Copy
Range("B2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("C:C").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
Range("L1").Select
ActiveCell.FormulaR1C1 = "Collector"
Range("L2").Select
Selection.FormulaR1C1 = _
"=VLOOKUP(RC[-11],'[Accounts By Collector.xlsx]aging'!R2C1:R5301C5,5,0)"
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
Selection.Copy
Range("A2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, 11).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Columns("L:L").Select
Application.CutCopyMode = False
Selection.Copy
Selection.PasteSpecial Paste:=xlPasteValues, Operation:=xlNone, SkipBlanks _
:=False, Transpose:=False
Application.CutCopyMode = False
Range("F1").Select
ActiveCell.FormulaR1C1 = "Current"
Columns("L:L").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("L1").Select
ActiveCell.FormulaR1C1 = "Over 60"
Columns("L:L").Select
Selection.Insert Shift:=xlToRight, CopyOrigin:=xlFormatFromLeftOrAbove
Range("L1").Select
ActiveCell.FormulaR1C1 = "Over 30"
Range("L2").Select
Selection.FormulaR1C1 = "=SUM(RC[-4]:RC[-1])"
Selection.Style = "Comma"
Selection.Copy
Range("N2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, -1).Range("A1").Select
ActiveCell.Select
ActiveWindow.SmallScroll Down:=-9
Range("N2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, -2).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("L2").Select
Application.CutCopyMode = False
Selection.FormulaR1C1 = "=SUM(RC[-4]:RC[-1])"
Selection.Style = "Comma"
Selection.Copy
Selection.End(xlDown).Select
Selection.End(xlUp).Select
ActiveWindow.SmallScroll Down:=-6
Range("N2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, -2).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("M2").Select
Application.CutCopyMode = False
Selection.FormulaR1C1 = "=SUM(RC[-4]:RC[-2])"
Selection.Style = "Comma"
Selection.Copy
Range("N2").Select
Selection.End(xlDown).Select
ActiveCell.Offset(0, -1).Range("A1").Select
Range(Selection, Selection.End(xlUp)).Select
ActiveSheet.Paste
Range("N2").Select
Application.CutCopyMode = False
Range("A1").Select
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 6
ActiveWindow.ScrollColumn = 5
ActiveWindow.ScrollColumn = 4
ActiveWindow.ScrollColumn = 3
ActiveWindow.ScrollColumn = 2
ActiveWindow.ScrollColumn = 1
With ActiveWindow
.SplitColumn = 0
.SplitRow = 1
End With
ActiveWindow.FreezePanes = True
Selection.AutoFilter
End Sub