Renaming Excel

Acorn

Board Regular
Joined
Sep 3, 2003
Messages
90
Hi...

Is it possible to change the name that you see at the top of the excel so that instead of it saying 'Microsoft Excel-Book 1' you can make it say something else like 'Acorn Book'

THanks
Acorn
 

Excel Facts

Does the VLOOKUP table have to be sorted?
No! when you are using an exact match, the VLOOKUP table can be in any order. Best-selling items at the top is actually the best.
Something like this...don't really like this method of changing the GUI, but it should do what you ask for...
Code:
Application.Caption = "Acorn Book"
 
Upvote 0
Right click a sheet tab and select View Code. Paste this in there and hit F5
Code:
Sub RenameMe()
    Application.Caption = "Atmospheric"
End Sub

ALT+TAB to get back to your sheet.

Note that Excel will remain named "Atmospheric" until you rename it by running the sub again or exiting Excel.

You can also got to the ThisWorkbook module and put:
Code:
Private Sub Workbook_Open()
   Application.Caption = "MyCaption"
End Sub

Private Sub Workbook_BeforeClose (Cancel As Boolean)
   Application.Caption = "MyCaption2"
End Sub
Hope that helps,

Smitty
 
Upvote 0
Thanks Cheapskate, sorry, Pennysaver, could you just explain the second part of the second suggestion please:

Private Sub Workbook_BeforeClose (Cancel As Boolean)
Application.Caption = "MyCaption2"
End Sub
 
Upvote 0
Sure AirHead :devilish:

For cases when you rename Excel something application specific in a Workbook_Open event, like "Financial Management System" and don't want Excel to retain that name when the workbook is closed, you rename it when you close it in a Workbook_BeforeClose event.

I usually use something sophmoric like "Macrosofa XL"

Make sense?

Smitty
 
Upvote 0
What doesn't make sense?

From the VBA Help File:

BeforeClose Event

Occurs before the workbook closes. If the workbook has been changed, this event occurs before the user is asked to save changes.

Syntax

Private Sub Workbook_BeforeClose(Cancel As Boolean)

Cancel False when the event occurs. If the event procedure sets this argument to True, the close operation stops and the workbook is left open.

BeforeClose Event Example

This example always saves the workbook if it's been changed.

Private Sub Workbook_BeforeClose(Cancel as Boolean)
If Me.Saved = False Then Me.Save
End Sub

That help any?

Smitty
 
Upvote 0
Yes, that's a little clearer thanks, but the reason I asked is that the part quoted seemed to have no effect. I left it in place, but the workbook still opened as I had renamed it, i.e. it didn't cancel the first action.
 
Upvote 0

Forum statistics

Threads
1,207,258
Messages
6,077,345
Members
446,279
Latest member
hoangquan2310

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top