
Originally Posted by
Gord Dibben
If you will use this code, please make amendments to it.
Remove the line...........
ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
Gord
On Tue, 22 Aug 2006 09:11:33 -0700, Gord Dibben <gorddibbATshawDOTca> wrote:
>Unprotect the sheet, hide greens, re-protect the sheet.
>
>Something like this.
>
>Private Sub Workbook_BeforePrint(Cancel As Boolean)
> ActiveSheet.Unprotect Password:="justme"
> ActiveWorkbook.CustomViews("green rows hidden").Show
> ActiveWindow.SelectedSheets.PrintOut Copies:=1, Collate:=True
> ActiveWorkbook.CustomViews("green rows seen").Show
> ActiveSheet.Protect Password:="justme", DrawingObjects:=True, _
> Contents:=True, Scenarios:=True
>End Sub
>
>Right-click on the Excel Icon left of "File" on the menubar.
>
>Select "View Code"
>
>Copy/paste the BeforePrint code above into that module.
>
>
>Gord Dibben MS Excel MVP
>
>
>On Tue, 22 Aug 2006 08:13:18 -0400, burnsbyrne
><burnsbyrne.2cxxr3_1156248907.5061@excelforum-nospam.com> wrote:
>
>>
>>I have several spreadsheets that I put together for other people to
>>enter data and report results. The sheets are made of about 25 sets
>>with four rows in each set. Rows #3 and #4 are where data is
>>entered. I have shaded them green to distinguish them from the rows
>>that contain formulas. Rows #1 and #2 are formulas, row #1 is a
>>percentage based on the numbers entered in rows 3 and 4, e.g. 75%. Row
>>2 is a fraction based on the numbers entered in rows 3 and 4, e.g. 3/4.
>>When the sheet is used as a report the green rows are hidden and the
>>report is printed. I set up two custom views called "green rows
>>hidden" and "green rows seen" to quickly switch back and forth between
>>the two views.
>>
>>These reports are being used by a variety of people with widely varying
>>computer skill. Despite frequent instruction some users regularly
>>over-write formulas. I tried protecting the sheets, leaving the data
>>entry cells unlocked, but when the sheets are protected, the custom
>>views don't work and the green rows can't be hidden. What I would like
>>to know is: is there a way to protect the formula cells and still be
>>able to hide cells using the custom view function?
>>
>>Thanks in advance!
>>
>>Mike
Gord Dibben MS Excel MVP
Bookmarks