Sam
Sam

Reputation: 3167

VBA combobox style

I have an Excel small interface. I changed a combobox style from fmStyleDropDownCombo to fmStyleDropDownList (I did this by - right click - Properties - Style). Now, I get an error:

"Could not set the Text property. Invalid property value"

on this line in VBA:

Worksheets("Sheet1").cmbSX.Text = Worksheets("Sheet2").Cells(9, 10)

This worked perfectly before I changed styles as described above (the change of style made the component uneditable manually). Any suggestion on how the code should be readjusted to this new style? Thank you!

Upvotes: 0

Views: 1645

Answers (1)

Doug Glancy
Doug Glancy

Reputation: 27478

Change Text to Value

Worksheets("Sheet1").cmbSX.Value = Worksheets("Sheet2").Cells(9, 10)

Upvotes: 1

Related Questions