Error: The Macro May Not Be Available In This Workbook Or All Macros May Be Disabled
Sophia Terry
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 Subwhen 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?
31 Answer
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.