Hi,
First off, take a look at the VBA tags we have here when posting, it will make your code look like mine does below.
Add this to your userform_initialize event, see if it helps ...
Private Sub CancelButton_Click()
Dim Msg As String
Dim Ans As Integer
Msg = "Cancel the wizard?"
Ans = MsgBox(Msg, vbQuestion + vbYesNo, APPNAME)
If Ans = vbYes Then Unload Me
End Sub
Public Sub UserForm1_Initialize()
MultiPage1.Value = 0
UpdateControls
With ActiveWorkbook
Me.TextBox1.Value = .Worksheets("sheet1").Range("b3").Value
Me.TextBox2.Value = .Worksheets("sheet2").Range("a9").Value
Me.TextBox3.Value = .Worksheets("sheet3").Range("a9").Value
End With
End Sub
Sub UpdateControls()
Select Case MultiPage1.Value
Case 0
BackButton.Enabled = False
NextButton.Enabled = True
Case MultiPage1.Pages.Count - 1
BackButton.Enabled = True
NextButton.Enabled = False
Case Else
BackButton.Enabled = True
NextButton.Enabled = True
End Select
End Sub
Private Sub BackButton_Click()
MultiPage1.Value = MultiPage1.Value - 1
UpdateControls
End Sub
Private Sub NextButton_Click()
MultiPage1.Value = MultiPage1.Value + 1
UpdateControls
End Sub
Private Sub FinishButton_Click()
With ActiveWorkbook
.Worksheets("sheet1").Range("b3").Value = Me.TextBox1.Value
.Worksheets("sheet2").Range("a9").Value = Me.TextBox2.Value
.Worksheets("sheet3").Range("a9").Value = Me.TextBox3.Value
End With
Unload Me
End Sub