ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   User form caption automatically populate with excel file name (https://www.excelbanter.com/excel-programming/375338-user-form-caption-automatically-populate-excel-file-name.html)

Steve

User form caption automatically populate with excel file name
 
I have a workbook that I do frequent updates to. Each time I do an
update I add an increment to the number in the filename with a "save
as". (i.e. Daily Report 3.x) The workbook contains a splash screen
which displays for a few seconds when it opens (userform). Is to
possible for the caption in this userform to automatically grab the
file name ? It would save me a few minutes each time I update it.

Thanks, Steve


JakeyC

User form caption automatically populate with excel file name
 
If your UserForm is called UserForm1, use

Private Sub Workbook_Open()
UserForm1.Caption = ThisWorkbook.Name
End Sub

in the ThisWorkbook code.

Steve wrote:
I have a workbook that I do frequent updates to. Each time I do an
update I add an increment to the number in the filename with a "save
as". (i.e. Daily Report 3.x) The workbook contains a splash screen
which displays for a few seconds when it opens (userform). Is to
possible for the caption in this userform to automatically grab the
file name ? It would save me a few minutes each time I update it.

Thanks, Steve



Steve

User form caption automatically populate with excel file name
 
Thanks JakeyC ... works perfectly !

Steve





JakeyC wrote:
If your UserForm is called UserForm1, use

Private Sub Workbook_Open()
UserForm1.Caption = ThisWorkbook.Name
End Sub

in the ThisWorkbook code.

Steve wrote:
I have a workbook that I do frequent updates to. Each time I do an
update I add an increment to the number in the filename with a "save
as". (i.e. Daily Report 3.x) The workbook contains a splash screen
which displays for a few seconds when it opens (userform). Is to
possible for the caption in this userform to automatically grab the
file name ? It would save me a few minutes each time I update it.

Thanks, Steve




All times are GMT +1. The time now is 12:11 PM.

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