+ Reply to Thread
Results 1 to 16 of 16

complicated hide/unhide rows on protected sheet

Hybrid View

achohan complicated hide/unhide rows... 06-07-2012, 11:07 AM
JBeaucaire Re: complicated hide/unhide... 06-07-2012, 12:31 PM
achohan Re: complicated hide/unhide... 06-07-2012, 01:33 PM
JBeaucaire Re: complicated hide/unhide... 06-07-2012, 02:38 PM
achohan Re: complicated hide/unhide... 06-07-2012, 02:52 PM
JBeaucaire Re: complicated hide/unhide... 06-07-2012, 07:33 PM
achohan Re: complicated hide/unhide... 06-08-2012, 08:23 AM
JBeaucaire Re: complicated hide/unhide... 06-08-2012, 09:15 AM
achohan Re: complicated hide/unhide... 06-08-2012, 12:02 PM
JBeaucaire Re: complicated hide/unhide... 06-08-2012, 01:12 PM
achohan Re: complicated hide/unhide... 06-08-2012, 01:27 PM
achohan Re: complicated hide/unhide... 06-21-2012, 02:27 PM
JBeaucaire Re: complicated hide/unhide... 06-08-2012, 02:26 PM
achohan Re: complicated hide/unhide... 06-08-2012, 02:41 PM
achohan Re: complicated hide/unhide... 06-08-2012, 02:44 PM
JBeaucaire Re: complicated hide/unhide... 06-08-2012, 03:44 PM
  1. #1
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: complicated hide/unhide rows on protected sheet

    I added some formulas into your column Y yellow cells that will put an "X" in the rows that are to be hidden.
    I added a BeforePrint macro into your ThisWorkbook module which will hide all the rows with text showing in column Y, print, then unhide.

    Private Sub Workbook_BeforePrint(Cancel As Boolean)
        Application.EnableEvents = False
        Cancel = True
        With Sheets("Budget Sheet")
            .Range("Y:Y").SpecialCells(xlCellTypeFormulas, 2).EntireRow.Hidden = True
            .PrintOut
            .Range("Y:Y").SpecialCells(xlCellTypeFormulas, 2).EntireRow.Hidden = False
        End With
        Application.EnableEvents = True
    End Sub
    If you're satisfied with the results, you can hide column Y.
    Attached Files Attached Files
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  2. #2
    Registered User
    Join Date
    05-29-2012
    Location
    Toronto,ON
    MS-Off Ver
    Excel 2007
    Posts
    14

    Re: complicated hide/unhide rows on protected sheet

    When i go to print i get and the below error

    run time error 1004
    unable to get the specialcells of the range class

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 2 users browsing this thread. (0 members and 2 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1