hello
is it possible:
If Me.Controls("CommandButton" & i).clicked Then
Sheets("tt").Range("C" & i).Value = Me.Controls("CommandButton" & i).Caption
End If
hello
is it possible:
If Me.Controls("CommandButton" & i).clicked Then
Sheets("tt").Range("C" & i).Value = Me.Controls("CommandButton" & i).Caption
End If
You could build a Class for Command Buttons or
Private Sub CommandButton1_Click() Call FillCell(1) End Sub Private Sub CommandButton2_Click() Call FillCell(2) End Sub Sub FillCell(i) Sheets("tt").Range("C" & i).Value = Me.Controls("CommandButton" & i).Caption End Sub
MVP (Excel 2008-2010)
Post a workbook with sample data and layout if you want a quicker solution.
To help indent your macros try Smart Indent
Please remember to mark threads 'Solved'
thank you very much