How do I hide cells in Excel

S

Sedge

I have a table that contains 5 phases of a process, I'd like to have the list
of 5 phase available at the top of the spreadsheet and when you click on each
of the phases I would like the boxes that are relevant to that phase to
appear is this possible?
 
A

Antal Kerekes

The function you need to use is the Group feature.
Just select the rows of each phase, then go to Data › Group and Outline ›
Group.
This will do the trick.
 
J

JE McGimpsey

Sedge said:
I have a table that contains 5 phases of a process, I'd like to have the list
of 5 phase available at the top of the spreadsheet and when you click on each
of the phases I would like the boxes that are relevant to that phase to
appear is this possible?

In addition to Antal's Group and Outline suggestion, you could use
macros to hide/unhide columns and rows when certain cells are selected.
I'd suggest using a double click, as the click/selection event is fired
when using the arrow keys, tab, return, etc.

Perhaps you could modify something like this (put it in the worksheet
code module: CTRL-click the worksheet tab and choose View Code):

Assuming A1:E1 contain the 5 phases:

Private Sub Worksheet_BeforeDoubleClick( _
ByVal Target As Excel.Range, Cancel As Boolean)
With Target
If Not Intersect(Range("A1:E1"), .Cells) Is Nothing Then
Rows("3:" & Me.Rows.Count).Hidden = True
Select Case .Column
Case 1
Rows("4:10").Hidden = False
Case 2
Rows("12:16").Hidden = False
Case 3
Rows("18:24").Hidden = False
Case 4
Rows("26:40").Hidden = False
Case Else
Rows("42:50").Hidden = False
End Select
End If
End With
End Sub
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top