+ Reply to Thread
Results 1 to 5 of 5

Hide / Unhide rows in a table that the first column cells are empty

  1. #1
    Registered User
    Join Date
    06-25-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2013 / 2016
    Posts
    69

    Hide / Unhide rows in a table that the first column cells are empty

    Hi, my problem is that I have a worksheet that multiple users have input to & in the tables are formulas etc & my code will not work due to the formulas. I need the tables locked so the user can only enter data into the cells that I want. P.s there are muliple tables in the worksheet so I cant have the table rows increasing in number.

    Long story short......Can I hide / unhide rows depending if col 1 is empty or not (using a command button)?


    Please Login or Register  to view this content.

  2. #2
    Registered User
    Join Date
    09-03-2014
    Location
    Lakewood, Ohio
    MS-Off Ver
    Office 365
    Posts
    12

    Re: Hide / Unhide rows in a table that the first column cells are empty

    Here is a macro that I use to hide rows, it might get you started, but you'll have to make one to unhide as well. I modified it to hide if Column A is blank.
    Sub HideMacro()

    Dim x As Integer
    x = 1

    Do Until x = 10000
    If Cells(x, 1).Value = "" Then
    Rows(x).Select
    Selection.EntireRow.Hidden = True
    x = x + 1
    Else
    x = x + 1
    End If
    Loop


    End Sub

  3. #3
    Registered User
    Join Date
    06-25-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2013 / 2016
    Posts
    69

    Re: Hide / Unhide rows in a table that the first column cells are empty

    Ah, thanks for the reply but I have multiple tables on the same sheet, can it be modified just to work on a specific table? eg. Table "Mod_T41"

  4. #4
    Registered User
    Join Date
    06-25-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2013 / 2016
    Posts
    69

    Re: Hide / Unhide rows in a table that the first column cells are empty

    I think I need to clarify further..........The tables I use have approx 25 rows but as well as entering data the users will have to delete data from a row meaning a blank row can exist in the middle of other rows that are filled with data so I created a sort button so that the blank rows would sort to the bottom. Due to having multiple tables it is a lot neater if the blank rows are hidden….hence the reason I would like a code to hide/unhide. I use filters at the moment but it would be neater if the blank rows would auto hide after “sorting”….I hope I’ve explained a bit better!!

  5. #5
    Registered User
    Join Date
    06-25-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2013 / 2016
    Posts
    69

    Re: Hide / Unhide rows in a table that the first column cells are empty

    I've stumbled across an easy solution.........."ShowAlldata" but a cell within the table must be selected first then simply filter on the coloumn I want. So basicaly it "unfilters" then sorts then filters on the colomn I need which will inturn hide all the blank rows at the bottom of my tables....All from a press of a button............VBA is the way to go!!


    Please Login or Register  to view this content.

+ 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. [SOLVED] Auto hide/unhide rows that have empty cells ( Preferably VBA Code)
    By carlandtina02 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-09-2016, 07:06 PM
  2. [SOLVED] First unhide all rows - then hide rows based on specific cell value for a range of cells
    By robbiekh in forum Excel Programming / VBA / Macros
    Replies: 9
    Last Post: 10-22-2013, 05:46 PM
  3. [SOLVED] VBA macro that hide and unhide column to respective rows based on first column value
    By janine6192 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-14-2013, 06:21 PM
  4. check box hide or unhide rows/column
    By makhdoomliaqat in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-28-2013, 08:15 AM
  5. Hide/Unhide a range of rows when cell is empty
    By chuck edwards in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 01-10-2012, 04:25 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