Results 1 to 6 of 6

hide rows based on value in specific column

Threaded View

beejay67 hide rows based on value in... 02-20-2020, 07:13 AM
Richard Buttrey Re: hide rows based on value... 02-20-2020, 07:23 AM
beejay67 Re: hide rows based on value... 02-20-2020, 07:26 AM
Richard Buttrey Re: hide rows based on value... 02-22-2020, 12:07 PM
beejay67 Re: hide rows based on value... 02-24-2020, 09:08 AM
Richard Buttrey Re: hide rows based on value... 02-24-2020, 09:27 AM
  1. #1
    Registered User
    Join Date
    07-05-2017
    Location
    Netherlands
    MS-Off Ver
    2013
    Posts
    19

    hide rows based on value in specific column

    Right now we have specific code to hide certain rows. It checks if in three different ranges if there is no value in a row and hides this row. This works very good.

    However we now need to hide the rows when the value in column 5 of a row is equal to "0,00". The ranges where we need to check this do not have to be changed.
    I already tried a lot of different methods, but can't get it working.

    The current code is:

    Sub HideEmptyRows()
        
        rnANVAjaar.Select
        rnANVAjaar.Unprotect
     
        Dim R1, R2, R3, AR, C As Range
             
        Set R1 = Range("A5:A24")
        Set R2 = Range("A33:A37")
        Set R3 = Range("A46:A50")
        
        Set AR = Union(R1, R2, R3)
        
        Application.DisplayAlerts = False
        Application.ScreenUpdating = False
        Application.Calculation = xlCalculationManual
            
        For Each C In AR
            If Len(C.Text) = 0 Then
                C.EntireRow.Hidden = True
            Else
                C.EntireRow.Hidden = False
            End If
        Next C
        
        rnANVAjaar.Protect
             
        Application.DisplayAlerts = True
        Application.ScreenUpdating = True
        Application.Calculation = xlCalculationAutomatic
         
    End Sub

    Can somebody help me out.

    Thanks in advance.

    Berend-Jan
    Last edited by beejay67; 02-20-2020 at 07:26 AM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. VBA to hide specific rows based on 2 variables
    By BC90 in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 09-11-2019, 05:26 AM
  2. [SOLVED] Need code to hide specific rows based on different cell value
    By majzeln in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 11-04-2016, 02:02 PM
  3. How do I hide specific rows based on values in a different worksheet?
    By mgolou in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 03-12-2014, 01:04 PM
  4. To hide/unhide rows based on specific value in a cell.
    By @jerry in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-28-2014, 11:56 AM
  5. [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
  6. Replies: 0
    Last Post: 06-11-2012, 02:36 PM
  7. Show/Hide Specific set of Rows based on Criteria in one cell
    By mrgillus in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 11-11-2010, 01:26 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