Hello Everyone,
Long time listener, first time caller.
I am trying to Hide/Unhide certain rows when a certain cell is populated by text, not assigned text either, just any text.
ex.
If "A1" is populated, then rows 5 $ 11-16 will Unhide. if "A1" has nothing in the cell the rows will hide.
I currently have put together the following (mostly from posts on this site)
It will hide/unhide rows when i enter the value "1" but i wan to change that to any text entered, not a value. Also, with the code i have when it hides the cells "flutter" for a couple seconds. is there any way to get rid of this? Thanks in advance!!!!!!!
Workbook
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Call unhide
End If
End Sub
Module
Sub unhide()
Range("A1").Select
If ActiveCell.FormulaR1C1 = "1" Then
Rows("4:6").Select
Selection.EntireRow.Hidden = False
Rows("10:17").Select
Selection.EntireRow.Hidden = False
Else: Selection.ClearContents
Rows("5:5").Select
Selection.EntireRow.Hidden = True
Rows("11:16").Select
Selection.EntireRow.Hidden = True
End If
End Sub
Long time listener, first time caller.
I am trying to Hide/Unhide certain rows when a certain cell is populated by text, not assigned text either, just any text.
ex.
If "A1" is populated, then rows 5 $ 11-16 will Unhide. if "A1" has nothing in the cell the rows will hide.
I currently have put together the following (mostly from posts on this site)
It will hide/unhide rows when i enter the value "1" but i wan to change that to any text entered, not a value. Also, with the code i have when it hides the cells "flutter" for a couple seconds. is there any way to get rid of this? Thanks in advance!!!!!!!
Workbook
Private Sub Worksheet_Change(ByVal Target As Range)
If Target.Address = "$A$1" Then
Call unhide
End If
End Sub
Module
Sub unhide()
Range("A1").Select
If ActiveCell.FormulaR1C1 = "1" Then
Rows("4:6").Select
Selection.EntireRow.Hidden = False
Rows("10:17").Select
Selection.EntireRow.Hidden = False
Else: Selection.ClearContents
Rows("5:5").Select
Selection.EntireRow.Hidden = True
Rows("11:16").Select
Selection.EntireRow.Hidden = True
End If
End Sub