View Full Version : combobox

12-18-2006, 12:32 AM
Good day VB experts!I have a problem on my current VBA excel. There are 2 columns that a user wants to select or type to search. Column A contains partcodes and ColumnB contains partnumbers. What codes to use when an optionbutton1 clicks the combobox rowsource is that of columnA and when optionbutton2 clicks the Rowsource is that of column B.Also pls consider the user to type on the combobox to whatever he wants to search.Thanks.Hamz

Bob Phillips
12-18-2006, 02:13 AM
Private Sub OptionButton1_Click()
ComboBox1.RowSource = "A1:A10"
End Sub

Private Sub OptionButton2_Click()
ComboBox1.RowSource = "B1:B10"
End Sub

12-18-2006, 05:25 AM
Check if it will help you: http://www.vbaexpress.com/kb/getarticle.php?kb_id=824 , there?s a file attached.