+ Reply to Thread
Results 1 to 5 of 5

Auto hide blank rows

Hybrid View

  1. #1
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Auto hide blank rows

    Put this in your worksheet area of the code:

    Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As Boolean)
    If UCase(Target) = "CLEAR" Then Range("E4:E" & Cells(Rows.Count, 1).End(xlUp).Row) = ChrW(9744): Cells.EntireRow.Hidden = False: Cancel = True: Exit Sub
    If Target = ChrW(9744) Then Target = ChrW(9745): Cancel = True: Exit Sub
    If Target = ChrW(9745) Then Target = ChrW(9744): Cancel = True: Exit Sub
    Dim cell As Range
    If UCase(Target) = "FILTER" Then
    Application.ScreenUpdating = False
    For Each cell In Range("E2:E" & Cells(Rows.Count, 1).End(xlUp).Row)
    If cell <> ChrW(9745) Then cell.EntireRow.Hidden = True
    Next cell
    Target = "Unfilter"
    Cancel = True
    Application.ScreenUpdating = True
    Exit Sub
    End If
    If UCase(Target) = "UNFILTER" Then Cells.EntireRow.Hidden = False: Target = "Filter": Cancel = True
    End Sub
    Write in any cell in row 1 (for example in D1) the word "Clear" and double click it.
    In column E, a bunch of 'checkboxes' will appear - double click them to toggle them.
    Write in any cell in row 1 (for example in E1) the word "Filter" and double click it.
    Only the 'checked' boxes will remain and the word 'Filter' changes to 'Unfilter'. Guess what that does :-)

    Enjoy.
    Last edited by JasperD; 04-13-2015 at 03:25 PM.
    Please click the * below if this helps

+ 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. Can I auto-hide rows or auto-set row height?
    By Hambone70 in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 07-03-2014, 01:25 AM
  2. Can I auto-hide rows or auto-set row height?
    By Hambone70 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-27-2014, 05:59 AM
  3. Can I auto-hide rows or auto-set row height?
    By Hambone70 in forum Excel General
    Replies: 2
    Last Post: 06-27-2014, 02:59 AM
  4. auto hide a row if the value of a cell is blank on a specific sheet.
    By russ8420 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 10-27-2012, 02:13 PM
  5. Hide Blank rows
    By Charity in forum Excel General
    Replies: 15
    Last Post: 11-23-2006, 08:20 AM

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