+ Reply to Thread
Results 1 to 8 of 8

Copying Filtered Results into a New Workbook using Macro's

  1. #1
    Registered User
    Join Date
    12-03-2006
    Posts
    15

    Copying Filtered Results into a New Workbook using Macro's

    Hi,

    I'm not a regular Macros user so have very limited experience.

    I'm currently have a workbook which refers to lots of different suppliers. I use the auto filter to view specific suppliers, but if I want to send this workbook to a supplier the information on the other suppliers is confidential and therefore the whole book can't be sent.

    Therefore I would like a Macro to export the filtered results into a new excel workbook which can then be sent to suppliers.

    I realise that there is an advanced filter option which can do this, however I need to make it as simple and intuative as possible as there will be many people using the spread sheet over time. So I would ideally like to put an "export filter results" at the top of the spread sheet.


    IS there somewhere you could point me to read up on what's required?


    Thanks,

    Stephen

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copying Filtered Results into a New Workbook using Macro's

    Try this
    Please Login or Register  to view this content.
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Norfolk UK
    MS-Off Ver
    2007
    Posts
    222

    Re: Copying Filtered Results into a New Workbook using Macro's

    Hi Roy,

    I have tried this at it seems to return runtime error 438

    at this point

    rng.Copy newWb.Cells(2, 1)

    its probably me, but i thought i could use this code as well

    cheers

    another Stephen

  4. #4
    Forum Contributor
    Join Date
    11-28-2008
    Location
    Norfolk UK
    MS-Off Ver
    2007
    Posts
    222

    Re: Copying Filtered Results into a New Workbook using Macro's

    sorry i changed the 1,1 to 2,1

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Copying Filtered Results into a New Workbook using Macro's

    I missed the sheet out
    Please Login or Register  to view this content.

  6. #6
    Registered User
    Join Date
    12-03-2006
    Posts
    15

    Re: Copying Filtered Results into a New Workbook using Macro's

    Hi Roy,

    Thanks very much for the reply, some very helpful stuff there.

    I can get the selection I need now to a new workbook and have also copied the column widths and formatting accross to. I kept getting a Runtime error 13 for the Save As loop, but have now deleted that as I don't need this to be automatic.

    However I need also to copy the row height accross as there may be pictures in some of the cells. Is there any way to do this?


    Thanks,

    Stephen

  7. #7
    Registered User
    Join Date
    11-10-2012
    Location
    Napa, CA, USA
    MS-Off Ver
    Excel 2010
    Posts
    4

    Re: Copying Filtered Results into a New Workbook using Macro's

    Hi Roy,

    I am totally new to VB and found this thread here - great stuff. I got the Macro to work in Excel 2010, however, I would like to copy the header rows (10 rows prior to filtered rows) as well, and maintain the column width from the source. Can you please help?

    Many thanks,

    Rene

  8. #8
    Forum Contributor arlu1201's Avatar
    Join Date
    09-09-2011
    Location
    Bangalore, India
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    19,166

    Re: Copying Filtered Results into a New Workbook using Macro's

    ovetcobo,

    Unfortunately you need to post your question in a new thread, it's against the forum rules to post a question in the thread of another user. If you create your own thread, any advice will be tailored to your situation so you should include a description of what you've done and are trying to do. Also, if you feel that this thread is particularly relevant to what you are trying to do, you can surely include a link to it in your new thread.
    If I have helped, Don't forget to add to my reputation (click on the star below the post)
    Don't forget to mark threads as "Solved" (Thread Tools->Mark thread as Solved)
    Use code tags when posting your VBA code: [code] Your code here [/code]

+ 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