+ Reply to Thread
Results 1 to 4 of 4

Select range if values are visible after filtering

  1. #1
    Registered User
    Join Date
    12-27-2012
    Location
    Panama
    MS-Off Ver
    Excel 2007
    Posts
    90

    Select range if values are visible after filtering

    Good day,

    I want to filter a table for values less than X

    select the visible values and then delete them,

    some times there are not any vlaues less than X, so I get an error when trying to select the visible values,

    I want to create an if statement saying if there are no visible values skip this part (this is where I have dificulties),

    Please let me know if there is a better way of writing this,



    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Select range if values are visible after filtering

    I couldn't duplicate your error, but I may not have understood. Perhaps something like this may help?

    Please Login or Register  to view this content.
    BTW what error were you getting.

  3. #3
    Registered User
    Join Date
    12-27-2012
    Location
    Panama
    MS-Off Ver
    Excel 2007
    Posts
    90

    Re: Select range if values are visible after filtering

    thanks a lot for the response,

    on error resume next will make it go to the next line of code or the next value in the for loop?

    because after the delete it suppose to execute another task before going to the next value in the loop,

    how can i check if there are no visible cells because I get a msg window saying there is an error because there are no visible cells,

    since there are no visible cells, I cant set the value to visible cells,

    upon adding an if statement, I get the same error, saying there are no visible cells in the table,

    would i be easier to include the header and say if count of visible cells >1 ?

    Please Login or Register  to view this content.
    Error ...

    Run-Time error '1004'
    no cells were found

  4. #4
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Select range if values are visible after filtering

    Did you try On Error Resume Next to see if it works for you? I again I couldn't duplicate your error, so I can't offer much more.

+ 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