So I have a macro that works fine when I go to Developer tab > Macros > (select the macro) > Run. But then I assigned the macro to a button (I tried a rectangle shape first, then a form control button - both were the same), it gives me an error when I click the button. The error says "Cannot run the macro "p-5100.xlsm'!GoalFormat2'. The macro may not be available in this workbook or all macros may be disabled". The macro is definitly in the workbook because I can run it from the Developer tab and macros are enabled (there is another macro which runs automatically upon a selection change event which works fine...) The macro is supposed to let people select some cells within a specific range, then press a button to turn them green (I know this is kind of silly because this is like a one-click thing anyway but it is part of a larger project). The really odd thing is it works fine when I run it myself through the developer tab but not when I click the button. The button worked before when I was using 2007 (In fact files I already created with the button in them still work), but new files created from this template in 2013 have the problem.
Code:
Sub GoalFormat2()
If Not Intersect(Range("I25:O29"), Selection) Is Nothing Then
'Change all the cells from column I to O in that row to white
Range("I" & ActiveCell.Row & ":O" & ActiveCell.Row).Interior.Color = 16777215
'Change the selected cells to green
Selection.Interior.ThemeColor = xlThemeColorAccent3
End If
End Sub