Sheet names to Cell values

KentKHI

Active Member
Joined
Oct 1, 2004
Messages
492
Is there a way to get a range of cells to show all of my current sheet names in that workbook? I need it to update any time I add, delete, or change a sheet name.

Thanks :biggrin:
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
WOW :eek: That is cool!

Now, to get it to update, There is no such thing as a workbook_change event, is there?

Any other thoughts to start off with?

Thanks a bunch for the link
 
Upvote 0
There is a Workbook_SheetChange event:
SheetChange Event
This example runs when any worksheet is changed.

Private Sub Workbook_SheetChange(ByVal Sh As Object, _
ByVal Source As Range)
' runs when a sheet is changed
End Sub
You could test for the ActiveSheet.Name and if it doesn't match what's in the list, then rerun the TOC code.

Smitty
 
Upvote 0
Hey Smitty!

Good to hear from you again! Thanks for the sub name!

I got it to work on any change, but what do you think I should do if I want it to only look at worksheet names?

Right now, the code runs any time I make a change in a worksheet, but I can delete a worksheet, and it won't change.

I'm not sure how to trigger this
 
Upvote 0
Got it.

I just set up my code to run everytime my "create or delete new workbook code" runs

So never mind my gibberish, and thanks again for a great lead Smitty.
 
Upvote 0

Forum statistics

Threads
1,214,918
Messages
6,122,249
Members
449,075
Latest member
staticfluids

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