Home » excel » Published Excel macro fails to be recognized

Published Excel macro fails to be recognized

Posted by: admin May 14, 2020 Leave a comment

Questions:

I downloaded this macro to apply names to worksheets (worth noting that this page is also referenced in Microsoft’s help pages somewhere). But when I try to run the macro, it’s like it doesn’t exist. If I select Macros from the Developer tab, it’s not there (and yes, I’ve checked “all open workbooks”). If I open the VB editor window and open the module, I can see the code, but selecting Run or Debug
F8 does nothing at all. No error, no highlighted code. All works as expected for all my other macros.
This is Excel2010 on Windows7Enterprise.

Any ideas?

How to&Answers:

You do not run this macro. It goes into the Worksheet_Change event which is the specific Worksheet object module (ie. Sheet1 object module, Sheet2 object module, etc).

It is an event that fires automatically when you modify a cell in worksheet.

There instructions how to run this are actually on that web so it’s worth reading them! 🙂

This is where the code should be placed

enter image description here

You can read more about the Worksheet_Change() event here


Just in case you still wander how to run this

place the code in the Sheet1 object module code area

go back to your spreadsheet Sheet1

type in a name in cell A1, and your sheet1 name will immediately change to whatever you’ve typed as long as it doesn’t cause macro to exit at some point. The restrictions are mentioned here