+ Reply to Thread
Results 1 to 9 of 9

Select filtered data

  1. #1
    Registered User
    Join Date
    05-01-2013
    Location
    Cov, England
    MS-Off Ver
    Excel 2003
    Posts
    60

    Select filtered data

    Hi I'm trying to select all visible data after the data has been filtered but I'm getting an error on range selection

    Code below

    anyone please help?

    Please Login or Register  to view this content.

  2. #2
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,557

    Re: Select filtered data

    You don't say what the error is but I suspect it hasn't found any records, maybe. Try trapping the error and exiting if Err.Number <> 0


    Regards, TMS
    Trevor Shuttleworth - Retired Excel/VBA Consultant

    I dream of a better world where chickens can cross the road without having their motives questioned

    'Being unapologetic means never having to say you're sorry' John Cooper Clarke


  3. #3
    Registered User
    Join Date
    05-01-2013
    Location
    Cov, England
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Select filtered data

    Hi, thanks for replying it displays

    Run-time erroe '1004':

    Method 'Range' of object'_Global' failed

    Then highlights the code i have selected red above

  4. #4
    Registered User
    Join Date
    05-01-2013
    Location
    Cov, England
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Select filtered data

    please any help?

  5. #5
    Forum Guru TMS's Avatar
    Join Date
    07-15-2010
    Location
    The Great City of Manchester, NW England ;-)
    MS-Off Ver
    MSO 2007,2010,365
    Posts
    48,557

    Re: Select filtered data

    I can't test it for you, I have nothing to test it with. Suggest you post a sample workbook with any sensitive data removed and instructions as to what you input and what you expect to get out.

    Does the filter work?


    Regards, TMS

  6. #6
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Select filtered data

    Hi, flashdisk,

    iRow is a local variable with no value set in your routine, and in my Excel no Row 0 exists (thus the error?)

    Ciao,
    Holger
    Use Code-Tags for showing your code: [code] Your Code here [/code]
    Please mark your question Solved if there has been offered a solution that works fine for you

  7. #7
    Registered User
    Join Date
    05-01-2013
    Location
    Cov, England
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Select filtered data

    Hi

    What I'm trying to do is filter the data on "AQVolume" sheet based with criteria of textbox235 value (date)
    Then copy the filtered results and the paste (transpose)the results to the sheet "AQ Summary" in cell A2

    Filter works, I believe that the only error I'm having with the code is selecting the filtered results

    Attached the spreadsheet, command button10 is located in the userform tab Phone performance Summary > Idle Time/AQ summary
    command button caption is "AQ"
    Attached Files Attached Files

  8. #8
    Forum Guru HaHoBe's Avatar
    Join Date
    02-19-2005
    Location
    Hamburg, Germany
    MS-Off Ver
    work: 2016 on Win10 (notebook), private: 365 on Win11 (desktop), 2019 on Win11 (notebook)
    Posts
    8,198

    Re: Select filtered data

    Hi, flashdisk,

    try it with the amendment of the blue code line
    Please Login or Register  to view this content.
    Maybe check if iRow is greater than 1 as that would mean there is data available.

    From what I saw from the code this needs a workout (no Select or Activate necessary to my knowledge).

    Ciao,
    Holger
    Last edited by HaHoBe; 06-02-2013 at 10:00 AM. Reason: typos - I even seem to have problems writing my Firstname

  9. #9
    Registered User
    Join Date
    05-01-2013
    Location
    Cov, England
    MS-Off Ver
    Excel 2003
    Posts
    60

    Re: Select filtered data

    Hi Holger, thanks for replying

    Cheers, Managed to get it to work now

+ 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