I modified your workbook slightly, added some code and a couple
of buttons from the Forms toolbar. I believe it does what you want.
1. Insert a row just above "auction items", call it Details and format it
the same as the Summary row.
2. Clear the outline
3. Add a button to cell B25 with the caption "Details"
4. Add a button to cell C25 with the caption "Summary"
5. Add a module to your workbook and insert the following code...
'-----------------------------------------------
Sub ShowTheDetails()
ActiveSheet.Unprotect
If Rows(27).Hidden = True Then
Rows("27:43").Hidden = False
Else
Rows("27:43").Hidden = True
End If
ActiveSheet.Protect
End Sub
Sub ShowTheSummary()
ActiveSheet.Unprotect
If Rows(45).Hidden = True Then
Rows("45:53").Hidden = False
Else
Rows("45:53").Hidden = True
End If
ActiveSheet.Protect
End Sub
'----------------------------------------------
6. Assign ShowTheDetails macro to the "Details" button.
7. Assign ShowTheSummary macro to the "Summary button.
I will be glad to send you the workbook with the changes in it, if you
would like to see it. Remove XXX from my email address.
Regards,
Jim Cone
San Francisco, USA
jim.c...@rcn.comXXX
"Robert Slattery" <RobertS...@discussions.microsoft.com> wrote in message
news:F8974C71-BD41-4E07...@microsoft.com...
Dave Peterson (thanks agin Dave) posted the following and it worked fine for
me. The only qualifiication is that someone who knows what they are doing
can edit the macro and see your password - not a problem in my case as I am
trying to protect the sheet from novices no experts!
'If you already have the outline applied, you can protect the worksheet in
code
(auto_open/workbook_open??).
Option Explicit
Sub auto_open()
With Worksheets("sheet1")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub
It needs to be reset each time you open the workbook. (excel doesn't remember
it after closing the workbook.)
If you're new to macros, you may want to read David McRitchie's intro at:
http://www.mvps.org/dmcritchie/excel/getstarted.htm'
Next time you're in the VBE, select that project.
Then Tools|VBAProject Properties|Protection Tab
But this protection can be broken in a matter of seconds--if the user knows how.
But it does keep most out.
--
Dave Peterson
Instead of adding VBA language and buttons to run the script backend to
ungroup/group columns, is there any other ways in Excel that will facilitate
the same process?
Any feedback will be greatly appreciated