Saludos Profesor Sergio, de ante mano gracias por responder, realice lo que me sugirió coloque el código donde me indicó, sin embargo me sigue arrojando el mismo error.
' Restaurar formato de fuente
With wsHistorico.Rows("2:2").Font
.ColorIndex = xlAutomatic
.TintAndShade = 0
End With
' Incrementar automáticamente el número de recibo
wsRecibo.Range("J2").Value = wsRecibo.Range("J2").Value + 1
'Corrección de Error en impresión
Application.Wait (Now + TimeValue("0:00:01"))
' Imprimir
wsRecibo.PrintOut Copies:=1, Collate:=True, IgnorePrintAreas:=False
Por
dorgelis, · publicado
buenas tardes como puedo modificar esta macro para que busque en varias columnas y copie las filas que contenga el dato buscado
Sub copiar_y_borrar()
columna = Range("bz1").End(xlToLeft).Column
quebusco = InputBox("que dato quieres buscar")
If quebusco = "" Then Exit Sub
ActiveSheet.Range("a1").CurrentRegion.Sort key1:=Range("a1"), order1:=xlAscending, Header:=xlYes, ordercustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
Set busca = ActiveSheet.Range("a2:a" & Range("a10000").End(xlUp).Row).Find(quebusco, LookIn:=xlValues, lookat:=xlWhole)
If Not busca Is Nothing Then
ubica = busca.Address
Range(ubica).Select
valor = ActiveCell.Value
fila = ActiveCell.Row
contarsi = Application.WorksheetFunction.CountIf(Columns(1), valor)
Range(Cells(fila, 1), Cells(fila + contarsi - 1, columna)).Copy
Sheets("copiados").Select
Cells(Range("copiados!a10000").End(xlUp).Row + 1, 1).PasteSpecial Paste:=xlValues
Do While ActiveCell.Value <> ""
ActiveCell.Offset(1, 0).Select
Loop
ActiveCell. Value = "******************"
Sheets("hoja1").Select
Range(Cells(fila, 1), Cells(fila + contarsi - 1, columna)).EntireRow.Delete
Application.CutCopyMode = False
End If
End Sub
gracias