- 24 Jul 2018 às 18:07
#35166
Sub Atualizar_Registros3()
'On Error Resume Next
Dim Item As ListItem
Dim LinhaFinal As Integer
Dim i As Integer
Frm_Prosp.listMenbro.ListItems.Clear
LinhaFinal = Plan4.Cells(Rows.Count, 1).End(xlUp).Row
For i = 2 To LinhaFinal
Set Item = Frm_Prosp.listMenbro.ListItems.Add(Text:=Plan4.Cells(i, "a"))
Item.SubItems(1) = Plan4.Cells(i, "b")
Item.SubItems(2) = Plan4.Cells(i, "c")
Item.SubItems(3) = Plan4.Cells(i, "d")
Item.SubItems(4) = Plan4.Cells(i, "e")
Item.SubItems(5) = Plan4.Cells(i, "f")
Item.SubItems(6) = Plan4.Cells(i, "g")
Item.SubItems(7) = Plan4.Cells(i, "h")
Item.SubItems(8) = Plan4.Cells(i, "i")
Item.SubItems(9) = Plan4.Cells(i, "j")
Item.SubItems(10) = Plan4.Cells(i, "k")
Item.SubItems(11) = Plan4.Cells(i, "l")
Item.SubItems(12) = Plan4.Cells(i, "m")
Item.SubItems(13) = Plan4.Cells(i, "n")
Item.SubItems(14) = Plan4.Cells(i, "o")
Item.SubItems(15) = Plan4.Cells(i, "p")
Item.SubItems(16) = Plan4.Cells(i, "q")
Item.SubItems(17) = Plan4.Cells(i, "r")
Item.SubItems(18) = Plan4.Cells(i, "s")
Item.SubItems(19) = Plan4.Cells(i, "t")
Item.SubItems(20) = Plan4.Cells(i, "u")
Item.SubItems(21) = Plan4.Cells(i, "v")
Item.SubItems(22) = Plan4.Cells(i, "w")
Item.SubItems(23) = Plan4.Cells(i, "x")
Item.SubItems(24) = Plan4.Cells(i, "y")
Item.SubItems(25) = Plan4.Cells(i, "z")
Item.SubItems(26) = Plan4.Cells(i, "aa")
Item.SubItems(27) = Plan4.Cells(i, "ab")
Item.SubItems(28) = Plan4.Cells(i, "ac")
Item.SubItems(29) = Plan4.Cells(i, "ad")
Item.SubItems(30) = Plan4.Cells(i, "ae")
Item.SubItems(31) = Plan4.Cells(i, "af")
Item.SubItems(32) = Plan4.Cells(i, "ag")
Item.SubItems(33) = Plan4.Cells(i, "ah")
Item.SubItems(34) = Plan4.Cells(i, "ai")
O erro é apontado aqui:
Quando eu passo o cursor por cima de cada Item, aparece a mensagem: "Variável do objeto ou variável do bloco With não definida"