JulioTheLess
New Member
- Joined
- Dec 13, 2021
- Messages
- 17
- Office Version
- 2016
- Platform
- Windows
I was trying to make auto hiding of rows depends on the cell value, for example I typed no. "5", the entire rows for nos. 6 and 7 will be hidden.
Where are you going the type No. 5 in a certain cell for example?for example I typed no. "5"
Where are you going the type No. 5 in a certain cell for example?
I'm planning to have allotted cell for that on a different sheet wherein users easily input the no. of desired rows.View attachment 53497
Like this one sir.
Private Sub Worksheet_Change(ByVal Target As Range)
If Not Intersect(Target, Cells(6, 19)) Is Nothing Then
Sheets("sheet1").Rows(Target + 1).Resize(2).EntireRow.Hidden = True
End If
End Sub
VBA Code:Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Cells(6, 19)) Is Nothing Then Sheets("sheet1").Rows(Target + 1).Resize(2).EntireRow.Hidden = True End If End Sub [/QUOTE] its seems not working accordingly since, i was not able to show that the there are blank rows right after each nos.
its seems not working accordingly since, i was not able to show that the there are blank rows right after each nos.Well
as per your post #1
Put this in input Data code
And type no in J1
will hide rows 6& 7 in sheet1
VBA Code:Private Sub Worksheet_Change(ByVal Target As Range) If Not Intersect(Target, Cells(6, 19)) Is Nothing Then Sheets("sheet1").Rows(Target + 1).Resize(2).EntireRow.Hidden = True End If End Sub