You are on page 1of 1

Private Sub cmdOcultarFilas()

Dim R As Range

Set R = ActiveWindow.RangeSelection

Dim i As Integer
Dim sVal As String
Dim si As String

si = InputBox("Digite valor de celdas a Ocultar", "Digite un dato", 0)

For i = 1 To R.Rows.Count
sVal = R.Cells(i, 1).Value
If Trim(sVal) = Trim(si) Then
R.Rows(i).EntireRow.Hidden = True
End If
Next

End Sub

You might also like