You can play with this for a while. Maybe you can get some ideas on how it
works.
You need a UserForm with a command button from the toolbox and a multipage
control.
The code goes behind the UserForm. To access the UserForm code module,
double click on the form in design mode and the code module will display.
Copy and paste the code below:
Private Sub CommandButton1_Click()
Dim cb1 As CommandButton
Set cb1 = Me.CommandButton1
If Me.MultiPage1.Pages(0).Caption = "Hello" Then
cb1.BackColor = &HFFFF80
Else
cb1.BackColor = &H80FF80
Me.MultiPage1.Pages(1).Caption = "Hello"
End If
End Sub
Private Sub MultiPage1_Change()
Dim cb1 As CommandButton
Set cb1 = Me.CommandButton1
If Me.MultiPage1.Pages(1).Caption = "Hello" Then
Me.MultiPage1.Pages(1).Caption = ""
Me.MultiPage1.Pages(0).Caption = "Bye"
Me.MultiPage1.Value = 1
cb1.BackColor = &HFFFF80
End If
Then, in the Project window, double click on Module1 and put this code in:
Sub macRun()
UserForm1.Show
End Sub
You can run this sub to show the UserForm and then click the button and the
multipage tabs.
To close the UserForm, click the big X at upper right.