Excel VBA: how to store combo box current value to cell -


for login form, use below code store values of textbox , combo box controls in separate sheet, tags , text box values populated, combo box values alone not written cells. can point out mistake?

for each ccontrol in frmlogin.controls if ccontrol.name "txt*" or ccontrol.name "cb*"     sheet5.cells(m, 10).value = ccontrol.tag     sheet5.cells(m, 11).value = ccontrol.text     m = m + 1 end if 

next

you have use msforms comparison.

try this

dim ccontrol control dim m long  '~~> change applicable m = 1  each ccontrol in frmlogin.controls     if typeof ccontrol msforms.textbox or _     typeof ccontrol msforms.combobox         sheet5.cells(m, 10).value = ccontrol.tag         sheet5.cells(m, 11).value = ccontrol.text         m = m + 1     end if next 

Comments

Popular posts from this blog

image - ClassNotFoundException when add a prebuilt apk into system.img in android -

I need to import mysql 5.1 to 5.5? -

Java, Hibernate, MySQL - store UTC date-time -