Creating a macro which presses a button containing a recorded macro

  • Thread starter Thread starter petros89
  • Start date Start date
P

petros89

Is there any way I can create a button which repeatedly click another
button containing a macro? If so, please help me as I need it for my
school work.
 
Remove the Private keyword from in front of the commandbutton_click event, and use a sub like

Sub TryNow()
Dim i As Integer
For i = 1 To 10
Sheet1.CommandButton1_Click
Next i
End Sub
 
add a button in excel worksheet
right click and select view code

Private Sub CommandButton1_Click()
Call macro1
End Sub


petros89 yazdi:
 
Back
Top