Thread: Button Help
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips[_6_] Bob Phillips[_6_] is offline
external usenet poster
 
Posts: 11,272
Default Button Help

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Target.Address = "$H$1" Then
If Target.Value = "Detailed" Then
Target.Value = "Summary"
Else
Target.Value = "Detailed"
End If
With Target.Offset(1, 0).Resize(10, 1).EntireRow
.Hidden = Not .Hidden
End With
Target.Offset(0, 1).Activate
End If
End Sub


'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Dave" wrote in message
. ..
I've thought and worked on this all day without a successful solution, so

be
warned, I'm not very good at this.

First, I'm trying to make it where I can click on a cell and have the
following happen:
1. The cell value will change from Detailed or Summary, whichever is
opposite from when I click on it.
2. As the value changes, a varying amount of lines (depending on how
many details
are in each section) will either go hidden or unhide. Again,
whichever is opposite.


I'm trying to see if there is a way to get all that to happen without

using
a Commandbutton if possible (which I couldn't get to work successfully
either).

I have already hidden Column A where I have a one letter code to describe
each line as a heading, detail, or totals line. I want only the detail

rows
to hide.

Any help would be greatly appreciated.