vb.net - Issues in combobox selection -


i new vba excel , have been successful in putting conditional combobox dependent on drop down list selection, problem facing whenever click on item in combobox ,it not appear in box after click.

can please me in solving problem.

thank you

the code used :

    private sub combobox1_dropbuttonclick() combobox1.clear   if worksheets("sheet1").cells(2, 1).value = "phe" combobox1  row = 1 1300 .additem sheets("sheet2").cells(row, 6) next row end  end if  if worksheets("sheet1").cells(2, 1).value = "hss" combobox1 row = 2 56 .additem sheets("sheet2").cells(row, 8) next row end  end if  if worksheets("sheet1").cells(2, 1).value = "decanter" combobox1 row = 3 249 .additem sheets("sheet2").cells(row, 9) next row end  end if  end sub 

if able somehow interpret value selected, perhaps reset value of combobox. applies if value being selected properly, not visible in combobox.

combobox1.value = 

also, cleaner (writing code here, typos may exist).

private sub combobox1_dropbuttonclick()  combobox1.clear  select case worksheets("sheet1").cells(2, 1).value case "phe"   minrow = 1   maxrow = 1300   col = 6 case "hss"   minrow = 2   maxrow = 56   col = 8 case "decanter"   minrow = 3   maxrow = 249   col = 9 case else   'error handling end select  combobox1   row = minrow maxrow     .additem sheets("sheet2").cells(row, col)   next row end  end sub 

Comments

Popular posts from this blog

android - getbluetoothservice() called with no bluetoothmanagercallback -

sql - ASP.NET SqlDataSource, like on SelectCommand -

ios - Undefined symbols for architecture armv7: "_OBJC_CLASS_$_SSZipArchive" -