babi_milan
25-06-2014 18:14:04
Boa tarde gente, to com uma duvida terrível , estou fazendo um programa em vba excel, e tenho que retirar o que está escrito em alguns textbox e passar para um listbox, organizado em linhas. E não sei como fazer isso! me ajudem, por favor?
Coloquei o codigo
Private Sub btnAdcionar_Click()
With ListBox1
AddItem.List(0, 0) = txt_codigo
AddItem.List(0, 1) = cmb_tabela
AddItem.List(0, 2) = txt_material
AddItem.List(0, 3) = txt_marca
AddItem.List(0, 4) = txt_modelo
AddItem.List(0, 5) = txt_carac1
AddItem.List(0, 6) = txt_carac2
AddItem.List(0, 7) = txt_carac3
AddItem.List(0, 8) = txt_carac4
AddItem.List(0, 9) = txt_unidade
AddItem.List(0, 10) = txt_media
AddItem.List(0, 11) = txt_menor
AddItem.List(0, 12) = txt_loja
AddItem.List(0, 13) = txt_data
End With
End Sub
Mas da erro 424 objeto obrigatório. Não sei o que fazer, SOS.
Coloquei o codigo
Private Sub btnAdcionar_Click()
With ListBox1
AddItem.List(0, 0) = txt_codigo
AddItem.List(0, 1) = cmb_tabela
AddItem.List(0, 2) = txt_material
AddItem.List(0, 3) = txt_marca
AddItem.List(0, 4) = txt_modelo
AddItem.List(0, 5) = txt_carac1
AddItem.List(0, 6) = txt_carac2
AddItem.List(0, 7) = txt_carac3
AddItem.List(0, 8) = txt_carac4
AddItem.List(0, 9) = txt_unidade
AddItem.List(0, 10) = txt_media
AddItem.List(0, 11) = txt_menor
AddItem.List(0, 12) = txt_loja
AddItem.List(0, 13) = txt_data
End With
End Sub
Mas da erro 424 objeto obrigatório. Não sei o que fazer, SOS.