Pregunta para Luis Mondelo: Macro
Me ayudaste con esta macro hace algunos dias. Me surge otra inquietud mas bien necesidad. Podria ser que el valor buscado en este caso C11 no se arroje en J11. Me explico que sólo arroje en J11 los datos que estan a la derecha del valor buscado.. Algo asi como lo que hace el buscarV.
Sub busca_y_copia_VALORBUSCADO()
Sheets("hoja1").Select
Application.ScreenUpdating = False
Range("J11:L700").Clear
Sheets("basedatos").Select
Range("E1000").CurrentRegion.Sort key1:=Range("E1000"), order1:=xlAscending, Header:=xlYes,ordercustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
valor =Sheets("hoja1").Range("C11").Value
Set busca =ActiveSheet.Range("E1000:E" & Range("E10000").End(xlUp).Row).Find(valor, LookIn:=xlValues,lookat:=xlWhole)
If Not busca Is Nothing Then
ubica = busca.Address
Range(ubica).Select
fila = Range(ubica).Row
contarsi =Application.WorksheetFunction.CountIf(Range("E1000:E" & Range("E10000").End(xlUp).Row), valor)
Range(Cells(fila, 5), Cells(fila + contarsi - 1, 7)).Copy
Sheets("hoja1").Select
Range("J11").PasteSpecial xlPasteAll
End If
Application.ScreenUpdating = True
End Sub
Respuesta de yijo
1
