Macro that adds entry into a list

pyclen

Board Regular
Joined
Jan 17, 2022
Messages
85
Office Version
  1. 365
  2. 2019
Platform
  1. Windows
Hi therei appreciate any help I was provided already and may be provided now.

My question is a general question about a macro that can add a new entry into a list of tabs when a new tab is created or an existing duplicated.

I have a Menu tab with a list of tabs in my workbook, and have to manually enter the new tab that is created or was duplicated.

In other words my list is
Tab1
Tab2
Tab3
Tab4

So, when I create tab 5 I would like to get it added i would like to have it added automatically to the list.
 

Excel Facts

Why does 9 mean SUM in SUBTOTAL?
It is because Sum is the 9th alphabetically in Average, Count, CountA, Max, Min, Product, StDev.S, StDev.P, Sum, VAR.S, VAR.P.
You can trap when someone adds a sheet (NewSheet event) but I have not found a way to trap that someone has changed its name. So what happens in the list when "Sheet8" is added but they change the name to something else?
 
Upvote 0
Hi there,
Thank you for your reply however I have no idea what you mean by trap however the name update is also needed ( in a separate macro????)
 
Upvote 0
by "trap" I mean catch/realize/know when something happens (an event) and have code do something.
NewSheet event is how you can trap for the addition of a new sheet. In the meantime I've read that there is no 'sheet name change' event but the question has been asked and answered elsewhere. I Googled

ms excel event when worksheet name is changed

and got a few. Maybe try that and see what you find that you can use. Here's one:

 
Upvote 0

Forum statistics

Threads
1,214,650
Messages
6,120,734
Members
448,987
Latest member
marion_davis

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