Buscar datos en otra hoja

Dante Amor hizo ésta macro, necesito seleccionar las celdas de las columnas B y C de la fila activa que selecciona la macro y no sé cómo hacerlo. Le agradezco si me da una mano

Sub BuscarCodigo()
'Por.Dante Amor
Set h1 = Sheets("Hoja1")
Set h2 = Sheets("Hoja2")
'
If ActiveCell.Column <> 1 Or ActiveCell.Value = "" Then
MsgBox "Selecciona un código de la columna A", vbExclamation
Exit Sub
End If
Set b = h2.Columns("A").Find(ActiveCell.Value, lookat:=xlWhole)
If Not b Is Nothing Then
h2.Select
h2.Rows(b.Row).Select
Else
MsgBox "El código no existe", vbExclamation
End If
End Sub

2 respuestas

Respuesta
1

Cambia esta línea

h2.Rows(b.Row).Select

Por esta:

h2.Range("B" & b.Row, "C" & b.Row).Select

Respuesta
1

Me permito responderte:

Solo cambia la siguiente línea.

¡Gracias! 

No hay de que, pero creo que Dante se sintió.

Añade tu respuesta

Haz clic para o

Más respuestas relacionadas