Hello there,
I am not new anymore to VBA, but I'm still strugglin:
I have made 6 modules, all using the
Secondly they all use
Now because of the changing names for the file I would like to refer to a single Dim and Set statement in a 'overal' module, that will work for all 6 modules.
But I dont know what to do. I tried to refer to a sub
Referring to this
But I wont work if I refer to REGISTER in my module.
Is there a way to fix this?
I am not new anymore to VBA, but I'm still strugglin:
I have made 6 modules, all using the
Code:
Dim PROJECT As Workbook
Dim REGISTER As Worksheet
Secondly they all use
Code:
Set PROJECT = Workbooks("Project Register TEST.xlsm")
Set REGISTER = PROJECT.Sheets("ProjectRegister")
Now because of the changing names for the file I would like to refer to a single Dim and Set statement in a 'overal' module, that will work for all 6 modules.
But I dont know what to do. I tried to refer to a sub
Code:
Call DimAndRange
Referring to this
Code:
Public Sub DimAndRange()
Dim PROJECT As Workbook
Dim REGISTER As Worksheet
Const MAX = 2000
Set PROJECT = Workbooks("Project Register FINAL VERSION.xlsm")
Set REGISTER = PROJECT.Sheets("ProjectRegister")
End Sub
But I wont work if I refer to REGISTER in my module.
Is there a way to fix this?