Error: The Macro May Not Be Available In This Workbook Or All Macros May Be Disabled
It looks like the button became unassigned from the macro. Try reassigning the button to the macro.
When you first right click on the button and choose Assign Macro, if you look at the "Macro name" text box, it should show you what macro is currently assigned to the button.
Related videos on Youtube
Alex S
Updated on September 18, 2022Comments
-
Alex S over 1 year
I'm trying to adopt the solution from this post & I've modified the macro slightly (I only need to add on button click) so that it's now
Sub AdjustValue() Dim btnName As String Dim targetCell As String Dim addAmount As Integer btnName = Application.Caller targetCell = Mid(btnName, 5, Len(btnName)) addAmount = 1 ActiveSheet.Range(targetCell).Value = ActiveSheet.Range(targetCell).Value + addAmount End Sub
when I click my button, named 'Add_B3' it causes an error
The Macro May Not Be Available In This Workbook Or All Macros May Be Disabled
I've saved the macro to both the sheet that I'm working in & ThisWorkbook.
I have set my Macro Settings in the Trust Center to 'Disable all macros with notification' but even if I select 'Enable all macros' I still hit the error and I can't work out why?
-
bdr9 about 8 yearsTry reassigning the button to the macro.
-
Alex S about 8 years@bdr9 thanks, that was it. I just had to right click the button > Assign Macro > double click the macro name. Is there anywhere that I could have gone to check that the macro was assigned to the button?
-
bdr9 about 8 yearsWhen you first right click on the button and choose Assign Macro, if you look at the "Macro name" text box, it should show you what macro is currently assigned to the button.
-