+ Reply to Thread
Results 1 to 5 of 5

Auto-Update and Hide Array

  1. #1
    Forum Contributor
    Join Date
    01-09-2012
    Location
    Rochester Hills, United States
    MS-Off Ver
    Excel 2010
    Posts
    161

    Auto-Update and Hide Array

    What I have here is a summary sheet which is based on another sheet with user input: UpdateBlanks.jpg.
    Layout changes aside, I'm wondering if there's away to search the array and sort it based on whether or not there is something it the field and then send it to the bottom of the array. If it's no longer blank, then that value will move back to its original place in the array.

    Let's separate this into logical tables (not really tables because I have cells that are merged, and even if I unmerge them, I don't want a bunch of columns that are unused):
    Under Electrical Summary there are '2' columns (unfortunately these are merged, but if it's an issue I could unmerge them). The blank rows within Electrical summary are values on my other page that are simply conditionally formatted to white because the summary sheet has no value in that space. This summary page is simply a =IF('Sheet1'!D9 = "", "", 'Sheet1'!D9) - sometimes there is a formula on the summary sheet to calculate various things such as AC current and whatnot.

    So I'm thinking of the Electrical and Mechanical Summary boxes as arrays, if a value is blank, then it is moved to the bottom of the array. If both bottoms of the arrays are blank, then hide that row.
    Here, the last two rows are blank, so hide them: HideEnds.jpg.

    If there are any better solutions to what I'm trying to accomplish, please feel free to offer them. I'm open to try about anything, but keep in mind that these can't really become tables since I can't change the formatting of the form.

    Thanks!
    Nothing is absolute - a paradox in itself.

    Indirect Dynamic Data Validation (scroll to the bottom of the page)

  2. #2
    Forum Contributor
    Join Date
    01-09-2012
    Location
    Rochester Hills, United States
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Auto-Update and Hide Array

    Here's a little example of what I have in mind (also have to accommodate for hiding the bottom rows):
    Please Login or Register  to view this content.
    This will take place on a Worksheet_Activate() event.

  3. #3
    Forum Contributor
    Join Date
    01-09-2012
    Location
    Rochester Hills, United States
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Auto-Update and Hide Array

    Please Login or Register  to view this content.
    I have this, but I don't know how to accommodate for all cells in that row being blank. Currently, if any cell is blank, it'll make the entire row blank. My code for if cell.Value <> "" doesn't capture the event where the furthest most cells are blank; therefore, regardless of whether or not everything to the left of it is blank, it will make that entire row blank.

    And I'm still trying to figure out how to sort and send items to the bottom of the list to make sure all blank values are able to be hidden rather than filling up blank spaces in the list.

    And to add to this, the application runs a bit slow because it's searching through that entire range (A9:I33). My computer takes a second for it to process, so I imagine slower computers might have a difficult time doing this every time.

  4. #4
    Forum Contributor
    Join Date
    01-09-2012
    Location
    Rochester Hills, United States
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Auto-Update and Hide Array

    Any ideas? I'm stuck at this point as far as sorting goes.
    I can hide specific rows (still only based on one cell), but it's not quite right - in addition to my code being less than efficient (to put it mildly).
    Last edited by Phoenix5794; 09-18-2012 at 01:57 PM.

  5. #5
    Forum Contributor
    Join Date
    01-09-2012
    Location
    Rochester Hills, United States
    MS-Off Ver
    Excel 2010
    Posts
    161

    Re: Auto-Update and Hide Array

    Eventually came up with my own solution:

    I just created another sheet and sorted the items there and then created a macro to copy the sorted table from the new sheet to my summary sheet and added formatting, etc to adjust it as I so pleased. Not the cleanest or most efficient solution (I'm sure), but it works for now.

    Sorry if this is considered to be reviving an old post, but I wasn't able to edit my original post or give it a solution otherwise.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 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