Correction of creation of CommandButton code

Closed
Myszak - Aug 24, 2018 at 08:58 PM
The formally correct code would be:

ActiveWorkbook.VBProject.VBComponents(ActiveSheet.CodeName).CodeModule

... as <Sheet>.Name is only identical to <Sheet>.CodeName, if the Sheet was never renamed !