Evening all,
I am currently looking for a way to unhide rows when particular cells are clicked on (Nothing typed, just clicked on)
I.e
When Cell E5 is clicked on, Rows 33 & 34 are unhidden to display a message.
When Cell E6 is clicked on Rows 33 & 34 would be hidden again, but rows 36 & 37 would become unhidden. Etc Etc. upto Cell E9 unhidden rows.
If none of the rows are clicked on then rows 33 to 40 would stay hidden.
i have seen code
from pages
http://www.mrexcel.com/forum/excel-questions/467136-hide-unhide-certain-rows-if-cell-populated.html
which seems to work in un-hiding the rows however i have to type into the cells in order for it to work.
i need the rows to unhide when i click on the cell.
Any help or pointers on how to create would be greatly appreciated.
Thanks
Steve
I am currently looking for a way to unhide rows when particular cells are clicked on (Nothing typed, just clicked on)
I.e
When Cell E5 is clicked on, Rows 33 & 34 are unhidden to display a message.
When Cell E6 is clicked on Rows 33 & 34 would be hidden again, but rows 36 & 37 would become unhidden. Etc Etc. upto Cell E9 unhidden rows.
If none of the rows are clicked on then rows 33 to 40 would stay hidden.
i have seen code
Private Sub Worksheet_Change(ByVal Target As Range)
' Code goes in the Worksheet specific module
Dim rng As Range
' Set Target Range, i.e. Range("A1, B2, C3"), or Range("A1:B3")
Set rng = Target.Parent.Range("A1")
' Only look at single cell changes
If Target.Count > 1 Then Exit Sub
' Only look at that range
If Intersect(Target, rng) Is Nothing Then Exit Sub
' Action if Condition(s) are met (do your thing here...)
If LenB(Target.Value) <> 0 Then
Range("A5,A11:A16").EntireRow.Hidden = False
Else: Range("A5,A11:A16").EntireRow.Hidden = True
End If
End Sub
from pages
http://www.mrexcel.com/forum/excel-questions/467136-hide-unhide-certain-rows-if-cell-populated.html
which seems to work in un-hiding the rows however i have to type into the cells in order for it to work.
i need the rows to unhide when i click on the cell.
Any help or pointers on how to create would be greatly appreciated.
Thanks
Steve