Link to home
Start Free TrialLog in
Avatar of hkgal
hkgal

asked on

Prevent user to unhide rows

I got a code and works well on hide/unhide info base on column G values:

Sub HideData()
 Dim cel As Range
 
 For Each cel In Columns("G")
  If LCase(Trim(cel.Text)) = "NIL" Then

   Rows(cel.Row).EntireRow.Hidden = True

  End If
 Next cel
   
End Sub



Sub SHOWData()
 Dim cel As Range
 For Each cel In Columns("G")
  If LCase(Trim(cel.Text)) = "NIL" Then
   Rows(cel.Row).EntireRow.Hidden = False

  End If
 Next cel
End Sub


However, I want to protect and prevent the users to unhide the row information when it is hidden. Any method?

Help....thanks!
SOLUTION
Avatar of Bardobrave
Bardobrave
Flag of Spain image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of hkgal
hkgal

ASKER

I just want to prevent then unhide and with other function normal, also users can still unhide other rows except that programmed ones...
Well... and what about erasing those rows from the sheet? If users shouldn't be able to see them in any manner what's the point of having them there?
Avatar of Martin Liss
You could put the rows in a different sheet and then hide/protect the sheet.
Avatar of hkgal

ASKER

So no ways to hide the rows at the same time set things to prevent unhide?? in same place n worksheet?
I don't believe there is.
I don't know any way to directly block a cell or a row/column from show/hide.

Maybe by rendering them readonly? Have you tried it?
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial