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?