+ Reply to Thread
Results 1 to 4 of 4

export filtered data (including header row) to new workbook, maintain column width

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

    export filtered data (including header row) to new workbook, maintain column width

    Hi All,

    I am new to VB and this forum.

    I am working with an Excel worksheet which lists the data to many different suppliers. I cannot send this spreadsheet out without some sort of manipulation to ensure that a supplier does not see the other suppliers data. So I am using the autofilter to sort out the rows of data that pertain to a specific supplier, then copy and paste into a new WB before sending - a very time consuming task.

    I would like to create a Macro that copies the header rows (10 rows prior to filtered data) and filtered results to a new workbook, which I can then save with a new file name and send to the supplier. The copied columns should maintain the format including the width.

    I found this Macro from royUK (see link below) which works great for exporting, however, it doesn't include the header rows and the column width defaults to 8.43.

    http://www.excelforum.com/excel-prog...ng-macros.html

    I've modified the code to make it work for Excel 2010, however, failed miserably trying to make changes to copy header rows and to maintain the column width. Any help is greatly appreciated.


    Sincerely,

    Rene

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

    Re: export filtered data (including header row) to new workbook, maintain column width

    Can anyone help with this, please? The macro I currently have is as follows:

    Please Login or Register  to view this content.

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

    Re: export filtered data (including header row) to new workbook, maintain column width

    Do you have a sample file that you can upload?

    To Attach a File:

    1. Click on Go Advanced
    2. In the frame Attach Files you will see the button Manage Attachments
    3. Click the button.
    4. A new window will open titled Manage Attachments - Excel Forum.
    5. Click the Browse... button to locate your file for uploading.
    6. This will open a new window File Upload.
    7. Once you have located the file to upload click the Open button. This window will close.
    8. You are now back in the Manage Attachments - Excel Forum window.
    9. Click the Upload button and wait until the file has uploaded.
    10. Close the window and then click Submit.
    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]

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

    Re: export filtered data (including header row) to new workbook, maintain column width

    Thanks for your reply arlu1201. The file I currently work with contains confidential information and cannot be posted. I will create a sample file this weekend and then upload. Thanks again


    Finally got around to create a sample file and upload.
    Attached Files Attached Files
    Last edited by ovetcobo; 05-07-2013 at 11:29 AM.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Tags for this Thread

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