I have a sheet with several macro buttons that all do slightly different things and all is well, unless the user spam clicks different buttons somewhat quickly.
I'm not experienced enough to know if this is a common issue or something with the way my code works, but it seems that everything works correctly if a macro button is clicked and properly executes before another is clicked. Even spam clicking the same macro button seems to work well, but the moment two or more are clicked in rapid succession, the code doesn't execute properly.
The code itself just finds cells with particular values, and adds or deletes rows and sometimes copies and pastes from other areas of the sheet. For example, if you were to click button X to find part X of the worksheet and add a row below it, and spam click button Y to find part Y of the worksheet and delete a row above it, button Y will fail at finding the cell it needs to find (even though it exists) and trigger an error messagebox telling the user that part Y seems to be missing, and meanwhile button X will have some weird issues itself like deleting the wrong row as if it anticipated/compensated for what it expected Y to do.
I tried using CommandButton1.Enabled = False
for every command button at the start of macro and enabling the buttons again at the end of every macro, but I can still spam click the buttons regardless during the macro execution.
Is there an easy way to prevent other macro buttons from being clicked until the current macro code has run? I've tried disabling and enabling the buttons, I've tried adding wait times. If I can't solve this issue I will likely resort to saving a duplicate hidden worksheet that, upon error, is unhidden, and the problem worksheet deleted, another 'backup' copy of the duplicate is created and hidden, all the while the user is notified not to spam the macro buttons.