+ Reply to Thread
Results 1 to 7 of 7

Selecting the first x visible rows of a filtered table

  1. #1
    Registered User
    Join Date
    02-15-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    42

    Selecting the first x visible rows of a filtered table

    Hi everyone,

    I've been struggling with what I thought would be an easy problem.

    I have a table with slicers to filter the data. I'd like to make a macro to:

    - Ask user how many rows they want to copy from the table (variable x).
    - Select the first x visible rows of the table (including the header)
    - Copy the selected rows.

    After searching for a while, I couldn't find a way to select the top x visible rows from my table.

    Can I ask for your help please?

    Thanks!
    Last edited by DreamEyes; 09-27-2017 at 07:25 AM.

  2. #2
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Selecting the first x visible rows of a filtered table

    Hi,

    Perhaps this
    Please Login or Register  to view this content.
    Don
    Please remember to mark your thread 'Solved' when appropriate.

  3. #3
    Registered User
    Join Date
    02-15-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Selecting the first x visible rows of a filtered table

    Perhaps I should replace the definition of Awesome with your name! The macro works perfectly fine, thank you very much!

  4. #4
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Selecting the first x visible rows of a filtered table

    You're welcome. Please remember to mark the thread Solved.

  5. #5
    Registered User
    Join Date
    02-15-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Selecting the first x visible rows of a filtered table

    Done.

    I'm sorry, I have an extra question if that's OK.
    Would it be possible to select the table row minus the last column of the table?

    The last column of the table is hidden but I realised that it's being copied as well. I tried to add an offset but to no avail.

    Sorry for the hassle and thanks a lot for your help.

  6. #6
    Forum Guru xlnitwit's Avatar
    Join Date
    06-27-2016
    Location
    London
    MS-Off Ver
    Windows: 2010; Mac: 16.13 (O365)
    Posts
    7,085

    Re: Selecting the first x visible rows of a filtered table

    A small change should fix that
    Please Login or Register  to view this content.

  7. #7
    Registered User
    Join Date
    02-15-2014
    Location
    London
    MS-Off Ver
    Excel 2013
    Posts
    42

    Re: Selecting the first x visible rows of a filtered table

    I like your magic. It works!
    Many thanks!

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Format Filtered Visible Rows of Table
    By Redled89 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-27-2017, 12:40 AM
  2. [SOLVED] Only selecting visible cells in a table with hidden rows
    By pfeifferjoey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-02-2014, 09:22 AM
  3. Replies: 1
    Last Post: 03-16-2014, 08:52 PM
  4. Pivot table to refresh and source data to change using visible rows on a filtered sheet
    By papasmurfuo9 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-27-2014, 11:32 AM
  5. Selecting 2nd to last Visible row in a filtered list
    By PSBuskey in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 12-11-2013, 04:43 PM
  6. Use visible rows from autofilter to build Pivot table. Or use visible rows to Copy/Paste
    By mwhitedesigns in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-08-2012, 10:34 AM
  7. Excel 2007 : Copy Visible Filtered Rows between worksheets
    By lmsexcelforum in forum Excel General
    Replies: 0
    Last Post: 05-17-2009, 12:40 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