Creating a macro which presses a button containing a recorded macro

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.
 
B

Bernie Deitrick

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
 
K

kerem.erdogan

add a button in excel worksheet
right click and select view code

Private Sub CommandButton1_Click()
Call macro1
End Sub


petros89 yazdi:
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top