I have put together a Userform for entering data into a series of identical spreadsheets in the same workbook. The form contains a combo box that switches the active worksheet by selecting the sheet's number. However, once the new sheet is selected, the Userform continues to edit the cells in the original sheet (eg. Start with sheet 1; enter data; switch to sheet 2; data entered in the userform continues to enter values in sheet 1).
Is there a way to reset the user form without closing it so that the data will be entered into the active sheet?
Thanks
Code:
Private Sub SelectBidItem_Change()
'Code to select worksheet based on value in ComboBox
Sheets(SelectBidItem.value).Activate
End Sub
Private Sub userform_initialize()
' Code to populate values for list in ComboBox
With SelectBidItem
.AddItem "0"
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
.AddItem "8"
.AddItem "9"
.AddItem "10"
.AddItem "11"
.AddItem "12"
.AddItem "13"
.AddItem "14"
.AddItem "15"
.AddItem "16"
.AddItem "17"
.AddItem "18"
.AddItem "19"
.AddItem "20"
.AddItem "21"
.AddItem "22"
.AddItem "23"
.AddItem "24"
.AddItem "25"
.AddItem "26"
.AddItem "27"
.AddItem "28"
.AddItem "29"
.AddItem "30"
End With
End Sub
Is there a way to reset the user form without closing it so that the data will be entered into the active sheet?
Thanks
Code:
Private Sub SelectBidItem_Change()
'Code to select worksheet based on value in ComboBox
Sheets(SelectBidItem.value).Activate
End Sub
Private Sub userform_initialize()
' Code to populate values for list in ComboBox
With SelectBidItem
.AddItem "0"
.AddItem "1"
.AddItem "2"
.AddItem "3"
.AddItem "4"
.AddItem "5"
.AddItem "6"
.AddItem "7"
.AddItem "8"
.AddItem "9"
.AddItem "10"
.AddItem "11"
.AddItem "12"
.AddItem "13"
.AddItem "14"
.AddItem "15"
.AddItem "16"
.AddItem "17"
.AddItem "18"
.AddItem "19"
.AddItem "20"
.AddItem "21"
.AddItem "22"
.AddItem "23"
.AddItem "24"
.AddItem "25"
.AddItem "26"
.AddItem "27"
.AddItem "28"
.AddItem "29"
.AddItem "30"
End With
End Sub