S
Scott
I have a sheet named "Data" that I added a combo box to. I'm trying to use
the Worksheet_Activate() event to populate the combo box. After creating the
combo box, I left the "Input Range" blank and entered the below code in the
sheet's module. When I test the sheet by selecting it, I get an "object
required" error.
Just to test, I added an input range that contains blank cells, but left my
code as is. After testing it, the error went away, but my code doesn't fire.
I even put a test message box in to confirm that the Worksheet_Activate()
event below was not firing.
How can I populate a combo box that is on a sheet (not a form)?
CODE:
Private Sub Worksheet_Activate()
dropdown1.Clear
dropdown1.AddItem "Shift 1"
dropdown1.AddItem "Shift 2"
dropdown1.Text = dropdown1.List(0)
End Sub
the Worksheet_Activate() event to populate the combo box. After creating the
combo box, I left the "Input Range" blank and entered the below code in the
sheet's module. When I test the sheet by selecting it, I get an "object
required" error.
Just to test, I added an input range that contains blank cells, but left my
code as is. After testing it, the error went away, but my code doesn't fire.
I even put a test message box in to confirm that the Worksheet_Activate()
event below was not firing.
How can I populate a combo box that is on a sheet (not a form)?
CODE:
Private Sub Worksheet_Activate()
dropdown1.Clear
dropdown1.AddItem "Shift 1"
dropdown1.AddItem "Shift 2"
dropdown1.Text = dropdown1.List(0)
End Sub