change worksheet tab

Billm

Board Regular
Joined
Mar 19, 2002
Messages
88
I know this is a simple one .. but I cant find the answer in here using search .. so I've got to ask this question ..

I want to run a macro that gets the current worksheet name from the tab at the bottom and then changes it to a set string eg; "balance"

I know its simple .. but I dont know how to read the current worksheet name and change it .. cos the user may have manually changed the tab name.

Secondly .. is there a way of stopping the users from changing sheet tab names ?

Thanks
Bill
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
To answer your first question:

If ActiveSheet.Name <> "balance" Then ActiveSheet.Name = "balance"
 
Upvote 0
To answer your second question:

Go to tools|options|view tab|uncheck "Sheet tabs" Now the user can't see the sheet tabs, but he/she can cycle through them by pressing ctrl+PageUp or ctrl+PageDown...not sure if that is what you are looking for.
 
Upvote 0
Thanks guys for your help .. I now know how to check & change tab names.
I think hiding the tabs and making the users use contol keys to change tabs would irritate them .. but thanks for the suggestion ..

Is there no VB code I can use to disable changing of the tab name ?
 
Upvote 0

Forum statistics

Threads
1,213,546
Messages
6,114,253
Members
448,556
Latest member
peterhess2002

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