Me podrían ayudar a entender este código?
Publicado por Eddy (2 intervenciones) el 02/03/2018 22:49:58
Buenas a todos, tengo un trabajo y ya lo tengo terminado, el problema es que cierta parte no la termino de entender, sobre todo la segunda línea a partir de : "On Error GoTo...
Me gustaría que me ayudaran a saber lo que dice, las líneas en negrita, muchas gracias
-----------------------------------------------------
Private Sub ListBox1_Change()
On Error GoTo ERR:
L = ListBox1.List(ListBox1.ListIndex, 0)
Sheets("Hoja1").Select
While ActiveCell.Value <> "" And ActiveCell.Value <> L And ActiveCell.Value <> Val(L)
ActiveCell.Offset(1, 0).Select
Wend
mensaje = ListBox1.List(ListBox1.ListIndex, 0)
Sheets("Hoja2").Select
Rows("14:14").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Rows("14:14").Interior.Color = RGB(255, 255, 255)
Rows("14:14").Font.ColorIndex = RGB(0, 0, 0)
Range("B14").Select
ActiveCell.Value = mensaje
Unload Me
ERR:
End Sub
Me gustaría que me ayudaran a saber lo que dice, las líneas en negrita, muchas gracias
-----------------------------------------------------
Private Sub ListBox1_Change()
On Error GoTo ERR:
L = ListBox1.List(ListBox1.ListIndex, 0)
Sheets("Hoja1").Select
While ActiveCell.Value <> "" And ActiveCell.Value <> L And ActiveCell.Value <> Val(L)
ActiveCell.Offset(1, 0).Select
Wend
mensaje = ListBox1.List(ListBox1.ListIndex, 0)
Sheets("Hoja2").Select
Rows("14:14").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Rows("14:14").Interior.Color = RGB(255, 255, 255)
Rows("14:14").Font.ColorIndex = RGB(0, 0, 0)
Range("B14").Select
ActiveCell.Value = mensaje
Unload Me
ERR:
End Sub
Valora esta pregunta


0