+ Reply to Thread
Results 1 to 14 of 14

Copy Filtered Selected columns to new worksheet

  1. #1
    Registered User
    Join Date
    07-22-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    30

    Copy Filtered Selected columns to new worksheet

    Hi Everyone,

    i have worksheet with columns A to CH. i will filter certain data and now have to copy some of the columns from that filtered data to new work book.

    can any one suggest how we can do that using code?

    Regards
    Rajeev

  2. #2
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Filtered Selected columns to new worksheet

    code? as in VBA?
    If you are satisfied with the solution(s) provided, please mark your thread as Solved.
    Select Thread Tools-> Mark thread as Solved. To undo, select Thread Tools-> Mark thread as Unsolved.

  3. #3
    Registered User
    Join Date
    07-22-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy Filtered Selected columns to new worksheet

    yes. once i filter a set of data, i need only that filtered data and some columns to new workbook.
    Last edited by irajeev; 07-22-2015 at 09:11 PM.

  4. #4
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Filtered Selected columns to new worksheet

    use range.specialcells method
    https://msdn.microsoft.com/en-us/lib.../ff196157.aspx

    range.specialcells(xlCellTypeVisible).copy

  5. #5
    Registered User
    Join Date
    07-22-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy Filtered Selected columns to new worksheet

    Sorry mate. i have not got experience in coding at all. Can you provide me the entire code as an example. thanks for your help on this.

    Regards
    Rajeev

  6. #6
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Filtered Selected columns to new worksheet

    you cant really have a blanket answer to a broad question....(1 code that works for everything all the time)

    you are going to have to provide something to work with

  7. #7
    Registered User
    Join Date
    07-22-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy Filtered Selected columns to new worksheet

    i completely agree with you. below is similar format. if i filter by only vendor x, and would like to copy columns ( end User, Vendor, Start date, and ACCT)to new worksheet.Hope this is helpful. let me know if you need any further info.
    End User Vendor Start Date End Date Stage Notes ACCT
    a x 24/06/2015 25/07/2016
    b y 24/07/2015 25/08/2016
    c z 24/08/2015 25/09/2016
    d x 24/09/2015 25/10/2016
    e y 24/10/2015 25/11/2016
    f z 24/11/2015 25/12/2016

  8. #8
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Filtered Selected columns to new worksheet

    next time ...provide a worksheet when asked for sample data
    people do not want to data entry for you in order to answer your question

    ive setup a simple example of autofilter using J9 value (highlighted in yellow)
    Attached Files Attached Files

  9. #9
    Registered User
    Join Date
    07-22-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy Filtered Selected columns to new worksheet

    Sorry dnt look at this option at all. if i filter by customer "a", then i need to copy columns "A to C", "E","G" to new workbook not sheet
    Attached Files Attached Files

  10. #10
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Filtered Selected columns to new worksheet

    you want to run macro after you have filtered or you want the macro to filter for you?
    also new blank workbook?
    Last edited by humdingaling; 07-23-2015 at 10:31 PM.

  11. #11
    Registered User
    Join Date
    07-22-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy Filtered Selected columns to new worksheet

    Run the macro after done the filtering and filtered data with the desired columns to be on the new workbook. there will be different customers. so when i ever i select a customer, that filtered date along with the columns to be on new work book. new workbook should not have any macros.

  12. #12
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Filtered Selected columns to new worksheet

    its be much easier to copy everything across and delete columns that you dont want after wards then to select certain columns of information at a time

    see attached if it matches your requirements
    Attached Files Attached Files

  13. #13
    Registered User
    Join Date
    07-22-2015
    Location
    Sydney
    MS-Off Ver
    2013
    Posts
    30

    Re: Copy Filtered Selected columns to new worksheet

    Thanks a lot for this. but i have columns till CH. so it is big file. and 1500 different users. so it might take so much of time to copy some of the columns from every user.

  14. #14
    Forum Expert
    Join Date
    08-12-2012
    Location
    Sydney, Australia
    MS-Off Ver
    Excel 2010
    Posts
    5,636

    Re: Copy Filtered Selected columns to new worksheet

    unless you have left something out

    the code only copied across the filtered data so the 1500 users comment is invalid
    and if you only require 5 out of the first 7 columns only the 7 columns would be copied across so having up to CH doesn't matter?

+ 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] Copy Specific Columns from a Filtered Range
    By Saarang84 in forum Excel Programming / VBA / Macros
    Replies: 21
    Last Post: 05-16-2015, 12:38 AM
  2. Copy filtered Data into another worksheet based on selected criteria
    By TheresaHartigan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-27-2014, 09:39 AM
  3. Excel: Macro to copy selected cells from Worksheet to a specified Worksheet(s)
    By hzman in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-03-2013, 04:26 AM
  4. Copy filtered rows in one worksheet and paste to other worksheet
    By tsiddiq23 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 02-04-2013, 05:13 AM
  5. Copy Filtered Data to another worksheet with VBA
    By BT Tan in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-24-2013, 11:48 AM
  6. [SOLVED] Copying selected cells from multiple rows and columns from worksheet to worksheet
    By janlindgren in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 05-25-2012, 02:58 AM
  7. Replies: 1
    Last Post: 04-08-2009, 02:37 AM

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