+ Reply to Thread
Results 1 to 4 of 4

Hide worksheets and rows based on empty cells

  1. #1
    Registered User
    Join Date
    07-02-2014
    Location
    Portland, ME
    MS-Off Ver
    2010
    Posts
    2

    Hide worksheets and rows based on empty cells

    So it's been years since I was away from any kind of visual basic programming and I just took a very excel heavy job, most which I can handle easily, but my company has a canned template for some of the work we do and to avoid wasting too much paper I wanted to insert some extra code into an already programmed macro button (which sets the page breaks) to hide forms (both as individual worksheets and rows within separate worksheets) if the field that ought to auto-fill them is left empty. Any help or handholding appreciated as I don't get a sit down with out tech guy for another week.

  2. #2
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hide worksheets and rows based on empty cells

    Can you post the template code??
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  3. #3
    Registered User
    Join Date
    07-02-2014
    Location
    Portland, ME
    MS-Off Ver
    2010
    Posts
    2

    Re: Hide worksheets and rows based on empty cells

    I wish I could post the code, but the nature of my firm's work is both sensitive and proprietary. It is not an extremely complex document; the VB code contained within is relatively simple, just a couple buttons to hide sheets/rows, or other buttons to unhide the same sheets/rows (but specifying the sheets to be hidden, not basing them on a cell value), and page break commands, with the rest of the document being purely formatting to make our presentations look nice.

    However, I can describe the exact gist of what it is I'm trying to do without describing exactly the contents of the document.

    On the title page there is a pre-programmed macro button which, when pressed, sets the page breaks for the document to make it look pretty. For the sake of anonymity let's say that data entered into the document pertains to weather, so all the sheet names have been changed to reflect that. I want to add code to the page break button so that if any of the seven daily fields in "Weather Data" is empty, for argument's sake we'll say "Saturday" (G22) is left empty, so that the worksheet "Saturday Specifics" is hidden and the rows for Saturday's forecasted temperatures are hidden on the "Hourly Forecast" worksheet, but also so that if the field is later filled in those sheets and rows become visible again on another press.

    I know that what I want to do will require separate code for hiding the worksheets and the specific rows within the other worksheet, and I've tried to get snippets of similar code off both this and other excel help forums, but I can't seem to make any of them work for what I am doing. I am also open to programming an entirely new macro to execute this code and am truly open to any suggestions on how to move forward before presenting the initial changes and code that I've added/deleted to my tech guy. Currently the changes I'm making are only to the template used specifically by me, but knowing that the other end users I was trained by have the exact same problems. I would like to be able to present a cogent solution, or track toward a solution, to the issues we're having to our technology coordinator when I meet with him next Thursday.
    Last edited by bgasypher; 07-03-2014 at 09:15 AM.

  4. #4
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Hide worksheets and rows based on empty cells

    A mock up sample sheet and elementary code are the "finest kind" (!) of information for any of these type requests?? Can you post something concrete?

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Replies: 2
    Last Post: 06-11-2014, 10:49 AM
  2. Hide Rows on one Sheet based on cells in another sheet being empty
    By KDF in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-15-2013, 01:48 PM
  3. Replies: 0
    Last Post: 01-04-2012, 10:34 AM
  4. Excel 2007 : How to Hide rows if data cells are empty?
    By gene070752 in forum Excel General
    Replies: 0
    Last Post: 12-04-2011, 05:00 PM

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