Refresh Macro

kizzie37

Well-known Member
Joined
Oct 23, 2007
Messages
575
Office Version
  1. 365
I have a sheet in a workbook "Sheet Names List". Colum A has numbers 1 - 42 in rows 1 - 42. Column B has the following formula =IFERROR(INDEX(ListSheets,A1),""). I just need a macro that will "Refresh" this index list.

the reason for the need is because whenever I copy an exiting worksheet (as a template) and rename it, the "Sheet Names List" does not update with the new sheet name and continues to reference the old sheet name unless I manually refresh the formula. I want this to be automated.

Please can you assist
 

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
I have a sheet in a workbook "Sheet Names List". Colum A has numbers 1 - 42 in rows 1 - 42. Column B has the following formula =IFERROR(INDEX(ListSheets,A1),""). I just need a macro that will "Refresh" this index list.

the reason for the need is because whenever I copy an exiting worksheet (as a template) and rename it, the "Sheet Names List" does not update with the new sheet name and continues to reference the old sheet name unless I manually refresh the formula. I want this to be automated.

Please can you assist
Maybe a Worksheet_Change event can handle this. I have not tested this.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ThisWorkbook.Worksheets("Sheet Names List").Range("B1:B42").Calculate
End Sub
 
Upvote 0
Maybe a Worksheet_Change event can handle this. I have not tested this.

VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
ThisWorkbook.Worksheets("Sheet Names List").Range("B1:B42").Calculate
End Sub
Thanks dReid, Unfortunately this does not work. As soon as I copy an existing sheet it notes the name if the sheet "as copied" but wont log the name change to the sheet, which i need for a data validation in another tab. Is there another way to achieve this and keep the list updated?
 
Upvote 0
Thanks dReid, Unfortunately this does not work. As soon as I copy an existing sheet it notes the name if the sheet "as copied" but wont log the name change to the sheet, which i need for a data validation in another tab. Is there another way to achieve this and keep the list updated?
While looking for a solution, I came across this also, but I haven't tested it either. I was hoping the Worksheet_Change would have worked too. I may be able to look into this more later though.

 
Upvote 0
Thanks dReid, Unfortunately this does not work. As soon as I copy an existing sheet it notes the name if the sheet "as copied" but wont log the name change to the sheet, which i need for a data validation in another tab. Is there another way to achieve this and keep the list updated?
After you copy and rename the sheet, I would assume you are selecting "Sheet Names List" again? Does it not update after you select a new sheet?
 
Upvote 0
Maybe some more information will help.

Where is ListSheets located and how is it populated?

What is your process from start to finish when you copy/rename a sheet? (IE: Start on Sheet Names List, select sheet to be copied, copy/rename sheet, etc)
 
Upvote 0

Forum statistics

Threads
1,215,097
Messages
6,123,076
Members
449,094
Latest member
mystic19

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