Results 1 to 6 of 6

Hiding Unwanted Rows

Threaded View

  1. #1
    Registered User
    Join Date
    06-11-2013
    Location
    NZ
    MS-Off Ver
    Excel 2003
    Posts
    9

    Hiding Unwanted Rows

    Hi all you nice people.
    I have the following code which I 'stole' off a forum and changed parts to suit myself but it is not working correctly.


    Sheet5.Activate
     
    Dim cell As Range
    
    
    For Each cell In ActiveSheet.Range("J1:J40000")
    
    If (cell.Value = "") Then
    cell.EntireRow.Hidden = False
    End If
    Next cell
    
    For Each cell In ActiveSheet.Range("A1:A40000")
    
    cell.EntireRow.Hidden = (cell.Value <> Me.cboNHI.Value)
    
    End If
    Next cell
    I have a spreadsheet - Sheet5 - which copies 3 columns from a different sheet - Outcomes - and then I use Sheet5 to filter certain rows out by hiding them.
    The above code is supposed to UNHIDE every row to start and then HIDE the rows which match my ComboBox.

    It does actually work but it takes 15 minutes to chug through the first 40,000 rows to unhide them and another 15 minutes to hide the rows that don't meet my criteria.

    I am useless at coding but am still pretty darn pleased with myself to even get this far...hehehehe

    Can someone please help me out here so that it actually hides or unhides in a flash so to speak. The 40,000 is just a number because I have no idea how many rows each provider might enter so it can be the complete column if that's easier or better. Column J is in fact totally empty and was just my country boys way of trying to unhide all rows because I knew that that column had nothing in it.

    Thanks a bunch

    Turtle
    Last edited by FDibbins; 05-24-2014 at 06:48 PM. Reason: Code tags added :)

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Removing Unwanted Rows and summing the duplicate Rows
    By Cena in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-08-2010, 07:00 AM
  2. Hiding unwanted row fields from Pivot Table
    By raorajkumar in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-26-2008, 02:06 PM
  3. Hiding a button when hiding rows
    By fergusor in forum Excel General
    Replies: 2
    Last Post: 08-10-2006, 09:31 AM
  4. [SOLVED] Hiding a button when hiding rows
    By richard_m_ferguson@hotmail.com in forum Excel General
    Replies: 4
    Last Post: 08-09-2006, 02:19 PM
  5. [SOLVED] Hiding column/row labels --without hiding entire columns/rows
    By daniel.wolff@csfb.com in forum Excel General
    Replies: 2
    Last Post: 10-18-2005, 10:05 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