Velvet Star Monitor

Standout celebrity highlights with iconic style.

news

Error: The Macro May Not Be Available In This Workbook Or All Macros May Be Disabled

Writer 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 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.

macro locations

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?

3

1 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.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy