Results 1 to 3 of 3

Hiding multiple rows

Threaded View

  1. #1
    Forum Contributor
    Join Date
    08-03-2005
    Posts
    272

    Hiding multiple rows

    So I have several sheets that hide and unhide rows based on the word "unhide" in a cell.

    The code I use is below, it seams to run very very slowly, is there a faster alternative to this?

    Basically it takes a sheet, looks at each cell from 5 to 32 and hides or unhides based on the word "unhide" then it goes to the next sheet. Just takes forever.

    Sub DGS_Look()
    
    Dim vWShts As Variant
    Dim rCell As Range
    
        Sheets("Controls - Analyst").Range("G9") = "Total D&GS"
        
        vWShts = Array("1.0 Orders", "O ACC", "2.0 Revenue", "R ACC", "3.0 Earnings", "E ACC", "4.0 Margin", "5.0 Cash", "C ACC", "5.1 Receipts", "Rec ACC", "5.2 Expenditures", "Exp ACC", "6.0 EP", "7.0 RONA", "8.0 Net Assets")
        For i = 0 To UBound(vWShts)
            With Worksheets(vWShts(i))
                Sheets(vWShts(i)).Select
                    For Each rCell In Range("AS5:AS32")
                    rCell.EntireRow.Hidden = (rCell.Value <> "UNHIDE")
                    Next rCell
            End With
        Next i
        Sheets("Controls - Analyst").Select
    End Sub
    Last edited by caliskier; 02-05-2011 at 05:46 PM.

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