
27/08/2009, 17:48
|
| | Fecha de Ingreso: agosto-2009
Mensajes: 1
Antigüedad: 15 años, 8 meses Puntos: 0 | |
Aplicación con Visual Basic para excel Si en una hoja de calculo de excel tengo datos varios.
quiero que me seleccione algunos datos segun el valor de Texbox1.text y no toda la lista.
por alguna razon se me agregan todos. como debo hacer?
Desde ya muchas gracias por la ayuda.
With Worksheets(IDHoja).Range("a1:z200")
Set e = .Find(TextBox1.text, LookIn:=xlValues)
If Not e Is Nothing Then
firstaddress = e.address
Do
Set e = .FindNext(e)
últimaFila = últimaFila + e.Rows.Count
Loop While Not e Is Nothing And e.address <> firstaddress
End If
i = 1
For i = 1 To 10
grid1.MaxRows = i + 1
grid1.Row = i + 1
If Format(Worksheets(IDHoja).Range(e.Cells(i, 1).address), "mm/yyyy") = TextBox1.Text Then
grid1.Col = 1
If Not IsNull(Worksheets(IDHoja).Range(e.Cells(i, 1).address).Text) Then
grid1.Text = Worksheets(IDHoja).Range(e.Cells(i, 1).address).Text
End If
end if
Next i
End With |