I'm using Excel 2013 and new to VBA. I created a macro that served it's purpose with no errors. I then created a form control button and assigned the macro. tested it, worked great with no issues. Then I did two things before realizing the button is no longer working. 1st I used this code
on sheet1 and tested it. It worked with 1 issue, if the tab name already exists. I was going to add a line to handle the error but had other items to attend to first.
then I renamed the module containing the macro used for the form control button.
Now when I click on the button I get this: "Cannot run the macro "template V5.xlsm'!Copy Sheet Data to Closing RPD". The macro my not be available in this workbook or all macros may be disabled.
"template V5" is the workbook name and the macro is called "Copy_Paste_specal_Values"
"Copy sheet data to closing RPD" is the caption in the button.
Please help me understand how I managed to break everything in this workbook and if I can fix it.
Thank you for taking the time to read my issue. This is my first post on this forum.
How I solved it:
I am still unaware of the specific cause, however deleting all of the form control buttons, (I had 1 per sheet), creating new ones and creating a macro for each as opposed to my previous method, which was using the same macro on every button running this code
Now I have that code (31) times. 1 for each day of the month, with the sheet name added at the end for each. again I don't know what caused this which was half the reason for this post. If anyone else runs into this issue, please post the circumstances here.
I'm sure if this code above were more efficient, then I would not have run into the error mentioned at the beginning of the post.
Bookmarks