+ Reply to Thread
Results 1 to 4 of 4

macro to autofilter and copy first 15 lines visible lines in columns D:E

  1. #1
    Registered User
    Join Date
    03-12-2013
    Location
    Vienna
    MS-Off Ver
    Excel 2007
    Posts
    2

    macro to autofilter and copy first 15 lines visible lines in columns D:E

    Hello everybody,

    I am struggling to write a code that should do the following to my datatable (10 columns, cca 5000 lines, headers in first row):

    1. filter data based on some characteristic from column A (using autofilter)
    2. then filter data deeper based on some characteristic from column B
    3. sort values in column C from largest to smallest.
    4. copy range of first 15 values from columns D:E to another sheet.

    I have a problem with step 4.
    How can I tell excel to select only first 15 visible cells (they will be in various lines) and select only the selected range (D:E)

    Many thanks to any idea!

  2. #2
    Forum Expert tigeravatar's Avatar
    Join Date
    03-25-2011
    Location
    Colorado, USA
    MS-Off Ver
    Excel 2003 - 2013
    Posts
    5,361

    Re: macro to autofilter and copy first 15 lines visible lines in columns D:E

    Juraj123,

    Welcome to the forum!
    Give this a try:
    Please Login or Register  to view this content.
    Hope that helps,
    ~tigeravatar

    Forum Rules: How to use code tags, mark a thread solved, and keep yourself out of trouble

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

    Re: macro to autofilter and copy first 15 lines visible lines in columns D:E

    Hi, Juraj123,

    just to answer 4 (Autofilter must be on):
    Please Login or Register  to view this content.
    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

  4. #4
    Registered User
    Join Date
    03-12-2013
    Location
    Vienna
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: macro to autofilter and copy first 15 lines visible lines in columns D:E

    Perfect! Thank you both for your help guys!

    Have a nice day,
    Juraj

+ 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