Was wondering if anyone has ever had the experience when clicking a command button that it will fill in a cell( e.g. A1) with the name of a command button that was pressed (e.g. HC12).
Sub buttonSmart()
ActiveSheet.Cells(1, 1) = Application.Caller
End Sub
So this would automatically look at the command button properties look at the (Name) field and place it in Column 1 Row 1. Am I understanding this correctly?
You are better off getting your command button to what you want directly in the command button code. This makes application maintenance staight forward. I've rewriten your sample code with the statement needed to place the button name on your worksheet. HTH
Code:
Private Sub HC12_Click()
Range("A11,A43,A53,A67,A123,A168,A184,A194").Value = 1
Range("A1") = HC12.Name
End Sub