ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Change the name of the title bar to the name of the worksheet. (https://www.excelbanter.com/excel-programming/423461-change-name-title-bar-name-worksheet.html)

Dave

Change the name of the title bar to the name of the worksheet.
 
I am building a spread sheet for my network printers. I have created several
(approx 20) worksheets to represent each location that we have network
printers.
The spread sheet launches fine.. I can click each work sheet at the bottom
of the screen and the data shows up like i want it to,,, however,,, the top
title bar of each work sheet contains the file name ie..xxxxxxxx.xls.
My goal/desire is to have the name of the work sheet appear in the title
bar...
for instance,,, for instance... Currently, if I click on the 123 Main Steet
work sheet
the 123 Main Street work sheet appears,, but the title bar still shows the
sread sheet file name.. when I click on the 123 Main Street work sheet,, I
would like it to appear where the filename appears on the title bar for that
work sheet.
Is this something simple or am i going to have to get deep into the scripting?
thanks


Barb Reinhardt

Change the name of the title bar to the name of the worksheet.
 
Try putting this in the ThisWorkbook module. It should get you part of the
way.

Option Explicit

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.Caption = ActiveSheet.Name

End Sub

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"dave" wrote:

I am building a spread sheet for my network printers. I have created several
(approx 20) worksheets to represent each location that we have network
printers.
The spread sheet launches fine.. I can click each work sheet at the bottom
of the screen and the data shows up like i want it to,,, however,,, the top
title bar of each work sheet contains the file name ie..xxxxxxxx.xls.
My goal/desire is to have the name of the work sheet appear in the title
bar...
for instance,,, for instance... Currently, if I click on the 123 Main Steet
work sheet
the 123 Main Street work sheet appears,, but the title bar still shows the
sread sheet file name.. when I click on the 123 Main Street work sheet,, I
would like it to appear where the filename appears on the title bar for that
work sheet.
Is this something simple or am i going to have to get deep into the scripting?
thanks


Barb Reinhardt

Change the name of the title bar to the name of the worksheet.
 
Correction.


Option Explicit


Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Application.Caption = Sh.Name

End Sub

--
HTH,
Barb Reinhardt

If this post was helpful to you, please click YES below.



"dave" wrote:

I am building a spread sheet for my network printers. I have created several
(approx 20) worksheets to represent each location that we have network
printers.
The spread sheet launches fine.. I can click each work sheet at the bottom
of the screen and the data shows up like i want it to,,, however,,, the top
title bar of each work sheet contains the file name ie..xxxxxxxx.xls.
My goal/desire is to have the name of the work sheet appear in the title
bar...
for instance,,, for instance... Currently, if I click on the 123 Main Steet
work sheet
the 123 Main Street work sheet appears,, but the title bar still shows the
sread sheet file name.. when I click on the 123 Main Street work sheet,, I
would like it to appear where the filename appears on the title bar for that
work sheet.
Is this something simple or am i going to have to get deep into the scripting?
thanks



All times are GMT +1. The time now is 12:30 AM.

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