+ Reply to Thread
Results 1 to 7 of 7

search column and select rows

  1. #1
    Registered User
    Join Date
    05-04-2006
    Posts
    56

    search column and select rows

    hi,
    I have a very large spreadsheet i'm running a script to hide rows given the value of a cell in a column.
    Given its size the operation takes about 15-20 minutes to execute.

    Please Login or Register  to view this content.
    I think its taking too long because it's selecting the row, then hiding, and loops through until finished.

    My Question: Would it be quicker to have a Sub run through making non-adjacent selections of the rows that qualify then do 1 Hide Row operation? And what would be the best way to do this? Have done some searching but cant find a way.

    Cheers
    Cam

  2. #2
    Forum Contributor
    Join Date
    06-14-2008
    Posts
    153
    Hi,

    Or may be you can sort your data by column 45, make the hide in one shot and then sort your data back. Of course the feasibility of this option depends on the structure of your data.

    Regards.
    Welcome to: http://www.exceldigest.com/myblog/
    "Excel help for the rest of us"

  3. #3
    Registered User
    Join Date
    05-04-2006
    Posts
    56
    Hi,
    Afraid I cant do that. it's several reports in one where the Sub hides rows that have not returned a value from an array.

  4. #4
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    You could try adding the below.
    It turns off the screenflicker and also if your dealing with formulas it may help speed things up

    Please Login or Register  to view this content.
    'Your Code
    Please Login or Register  to view this content.
    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  5. #5
    Forum Contributor
    Join Date
    06-14-2008
    Posts
    153
    Ok, try this:

    1. Do autofilter for your data.
    2. In column 45 click the arrow of the list box.
    3. Select custom.
    4. In the list where it says "show rows where" .. select "Does not equal".
    5. In the list to the right select 1.

    This will hide all the rows with value "1".

    I hope it will satisfy your request.

    Regards.

  6. #6
    Registered User
    Join Date
    05-04-2006
    Posts
    56
    thanks sel1429.
    So simple i didn't think of it.

    cheers.

  7. #7
    Forum Contributor
    Join Date
    06-14-2008
    Posts
    153
    My pleasure.

+ Reply to Thread

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