I am trying to code a button that runs multiple functions as you click it each time. I was thinking of running a loop but can't seem to find a suitable loop syntax in the library.
This is what I think it should look like (have not touched VBA Excel in some months)
Private Sub CommandButton15_Click()
i As Click
r As Counter
i = CommandButton15.Click
For Each i In UserForm1
If r = 1 Then
TextBox1.Text = "Do 1st function"
ElseIf r = 2 Then
TextBox1.Text = "Do 2nd function"
Else
TextBox1.Text = "Do 3rd function"
End If
Next i
End Sub
The code and buttons/textboxes is in a Userform that comes up. Appreciate if anyone could help to figure out the syntax or an example.
Thanks!