Friday, July 28, 2023

Hide rows in excel based on cell value using VBA

Sub HideRow()
LineStart = 2
LineEnd = 16
ColumnNumber = 2
For i = LineStart To LineEnd
If Cells(i, ColumnNumber).Value <> "YourCellValue" Then
Cells(i, ColumnNumber).EntireRow.Hidden = True
Else
Cells(i, ColumnNumber).EntireRow.Hidden = False
End If
Next i
End Sub

No comments:

Post a Comment

How to get Ranking of the Students in Excel using RANK Function

=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...