This is the beginning of my code:
Private FilesPath As String
Private CostCentersPath As String
Private FinalPath As String
Private CurrentName As String
Private CostCenters As Worksheet
Private Final As Workbook
Private Template As Worksheet
Sub ReadySetGo()
FilesPath = "O:\MAP\04_Operational Finance\Accruals\Accruals_Swiss_booked\2017\Month End\10_2017\Advertising\automation\" 'path change ("automation")
CostCentersPath = FilesPath & "CostCenters.xlsx"
CurrentName = InputBox("Please adjust the final file name:", , "ABGR_2017-10_FINAL.xls.xlsx")
FinalPath = FilesPath & CurrentName
Set CostCenters = Workbooks("CostCenters.xlsx").Worksheets("Cost Center Overview")
Set Final = Workbooks(CurrentName)
Set Template = Workbooks("Template.xlsm").Worksheets("Template")
End Sub
Sub ReadySetGo is used only to assign values to variables and is called from other modules of the module. But obviously, with this method, I get an input window that appears every time sub is called. Is there any other way, besides the Workbook.Open event, to pass the CurrentName variable the value to other subsets of the module to avoid multiple InputBoxes?
Thanks Bartek
source
share