ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   File name as a variable (https://www.excelbanter.com/excel-programming/377680-file-name-variable.html)

Patrick Simonds

File name as a variable
 
In the code below, is there any way to replace the referance to "Vacation
Mark-up (PT Drivers) 2007.xls" with a variable which returns the current
document name?


Private Sub Add_Name_Click()

Unload EmployeeList

Application.EnableEvents = False
Application.ScreenUpdating = False

Windows("EmployeeList.xls").Activate
Range("A300").Select

Application.Run "EmployeeList.xls!UpdateName"

Workbooks("Vacation - Leave Book Master.xls").Activate

Application.ScreenUpdating = True
EmployeeList.Show

Application.EnableEvents = True

End Sub



Don Guillett

File name as a variable
 
MsgBox ActiveWorkbook.Name

--
Don Guillett
SalesAid Software

"Patrick Simonds" wrote in message
...
In the code below, is there any way to replace the referance to
"Vacation Mark-up (PT Drivers) 2007.xls" with a variable which returns
the current document name?


Private Sub Add_Name_Click()

Unload EmployeeList

Application.EnableEvents = False
Application.ScreenUpdating = False

Windows("EmployeeList.xls").Activate
Range("A300").Select

Application.Run "EmployeeList.xls!UpdateName"

Workbooks("Vacation - Leave Book Master.xls").Activate

Application.ScreenUpdating = True
EmployeeList.Show

Application.EnableEvents = True

End Sub





All times are GMT +1. The time now is 01:40 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com