Results 1 to 24 of 24

Slow Macro - Hide Row based on cell value

Threaded View

  1. #1
    Forum Contributor PY_'s Avatar
    Join Date
    09-23-2008
    Location
    Houston
    MS-Off Ver
    Office 2016
    Posts
    289

    Slow Macro - Hide Row based on cell value

    I have a macro that will hide a row based on a cell's value inside that row. The problem is, it seems to take a very long time to perform this task. I know our work machines here are slow but is there anything that can be done to the code below to speed it up?

    Screen updating and events are turned off.

    Private Sub Hide_Accessory_Rows()
        'The following hides or unhides rows.  "x" = Row is Visible
         Application.Calculation = xlCalculationManual
        Application.ScreenUpdating = False
        Dim rRange As Range, rCell As Range
        Dim strVal As String
        Set rRange = Range("Hide_Rows_Test")
            For Each rCell In rRange
                strVal = rCell
                rCell.EntireRow.Hidden = strVal = vbNullString
            Next rCell
        Application.Calculation = xlCalculationAutomatic
    End Sub

    "Hide_Rows_Test" =Gen_3!$CB$17:$CB$626
    Last edited by PY_; 03-04-2011 at 10:39 AM.

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