I recorded a macro to help me run code I have written. The code itself works. However, I cannot seem to create a button that will run the code.
With Summary
.Buttons.Add(1039.8, 60.6, 66.6, 28.8).Select
Selection.OnAction = "PERSONAL.XLSB!Clear_Error"
Selection.Characters.Text = "Clear"
With Selection.Characters(Start:=1, Length:=11).Font
.Name = "Calibri"
.FontStyle = "Regular"
.Size = 11
End With
Summary is the worksheet.The button is created but the button itself does nothing. Also, When I tried manually assigning the macro to the button, the code still does not work. However, when I run the code, it runs smoothly.
Thanks,
G
suband notfunction. Make sure you have only one button and right click on it and check if the macro has been assigned to it at all or not.Selects,.Activates,ActiveSheets andActiveWorkbooks as @K.Davis mentions.