Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
lauren_roberts08
 
Posts: n/a
Default unhide rows when cell is clicked

Hi everyone,

Is it possible to unhide a selection of rows when you click on a cell.
For example, if I had a cell that said "Fruit", and I clicked it, could
it unhide 5 rows below that contained specifc types of fruit (ie apple,
pear, orange etc).

I am in the very beginning stages of understanding excel so any help
would be greatly appreciated (but could it also be as straightforward
as possible!! thank you!!!)

Thanks!
lauren

  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Barb Reinhardt
 
Posts: n/a
Default unhide rows when cell is clicked

You might want to look at Tools - Autofilter. Do a search for autofilter
to get more info.

"lauren_roberts08" wrote:

Hi everyone,

Is it possible to unhide a selection of rows when you click on a cell.
For example, if I had a cell that said "Fruit", and I clicked it, could
it unhide 5 rows below that contained specifc types of fruit (ie apple,
pear, orange etc).

I am in the very beginning stages of understanding excel so any help
would be greatly appreciated (but could it also be as straightforward
as possible!! thank you!!!)

Thanks!
lauren


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Bearacade
 
Posts: n/a
Default unhide rows when cell is clicked


The other way of doing it involves VBA, I am not sure how comfortable
you are with it.

You only asked for it to be unhide, but you should consider that the
rows that are shown after a cell has been click "should" be hidden
after someone leaves that cell.

Open up your Visual Basic Editor (Alt + F11) or go to Tools - Macro -
Visual Basic Editor.

Go to Insert and select Module and put the following in it:

Sub unHideRows()

Dim Row1 As Integer
Dim Row2 As Integer

Row1 = ActiveCell.Row + 1
Row2 = Row1 + 4

Rows(Row1 & ":" & Row2).Select
Selection.EntireRow.Hidden = False

End Sub


Now within VB editor go to the sheet that your data is in (select it in
the Project Explorer (the window on the left), and enter the following
in it:

Private Sub Worksheet_SelectionChange(ByVal Target As Range)

On Error Resume Next
If Target.Address = "$A$1" Then
Call unHideRows
On Error GoTo 0
Exit Sub
End If

End Sub

Change $A$1 to the cell that will trigger the unhiding. if you have
multiple cells, put this in:

If Target.Address = "$A$1" or Target.Adress ="$B$1" then

again, this is just to unhide it, hiding after you are done is another
matter


--
Bearacade


------------------------------------------------------------------------
Bearacade's Profile: http://www.excelforum.com/member.php...o&userid=35016
View this thread: http://www.excelforum.com/showthread...hreadid=551578

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
unhide rows when cell is clicked lauren_roberts08 New Users to Excel 3 June 14th 06 03:06 AM
Unhide rows when you click a cell lauren_roberts08 Excel Discussion (Misc queries) 1 June 13th 06 08:27 PM
Help with this conditional IF statement C-Dawg Excel Discussion (Misc queries) 3 May 15th 06 06:01 PM
Possible Lookup Table Karen Excel Worksheet Functions 5 June 8th 05 09:43 PM
parse cell and insert rows? Gorrila Grod Excel Worksheet Functions 3 November 5th 04 08:19 AM


All times are GMT +1. The time now is 11:01 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"