Hello All,
I am trying to enter data onto a spreadsheet using a UserForm with controls on a multipage control. My combo boxes work when placed directly on the UserForm, but do not work when placed on a Multipage on the UserForm.
My code for the latter is:
Private Sub OKButton_Click()
ActiveWorkbook.Sheets("Sheet1").Activate
Range("E8").Select
ActiveCell.Offset(0, 0) = MultiPage1.Page1.ComboBox1.Value
ActiveCell.Offset(1, 0) = MultiPage1.Page1.ComboBox2.Value
ActiveCell.Offset(2, 0) = MultiPage1.Page1.ComboBox3.Value
ActiveCell.Offset(3, 0) = MultiPage1.Page1.ComboBox4.Value
ActiveCell.Offset(4, 0) = MultiPage1.Page1.ComboBox5.Value
MultiPage1.Page1.ComboBox1.Text = ""
MultiPage1.Page1.ComboBox2.Text = ""
MultiPage1.Page1.ComboBox3.Text = ""
MultiPage1.Page1.ComboBox4.Text = ""
MultiPage1.Page1.ComboBox5.Text = ""
MultiPage1.Page1.ComboBox1.SetFocus
End Sub
the above does not work when combo boxes are on a Multipage.
Private Sub OKButton_Click()
ActiveWorkbook.Sheets("Sheet1").Activate
Range("E8").Select
ActiveCell.Offset(0, 0) = ComboBox1.Value
ActiveCell.Offset(1, 0) = ComboBox2.Value
ActiveCell.Offset(2, 0) = ComboBox3.Value
ActiveCell.Offset(3, 0) = ComboBox4.Value
ActiveCell.Offset(4, 0) = ComboBox5.Value
ComboBox1.Text = ""
ComboBox2.Text = ""
ComboBox3.Text = ""
ComboBox4.Text = ""
ComboBox5.Text = ""
ComboBox1.SetFocus
End Sub
The above DOES] work when placed directly on the UserForm.
Any help would be appreciated as this is the first time that I have tried to use Multipage and my project requires several of them.
Thanks!
Bookmarks