+ Reply to Thread
Results 1 to 6 of 6

Export two worksheets from a workbook and save with a name

  1. #1
    Registered User
    Join Date
    02-23-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    33

    Export two worksheets from a workbook and save with a name

    Hi been looking around a bit and could not really find a good solution to, with VBA, export two worksheets from a workbook into a new workbook and save it in a predefined directory.
    Last edited by thylander; 03-21-2011 at 04:54 AM.

  2. #2
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export two worksheets from a workbook and save with a name

    This shows a basic method, I used my own naming convention since you didn't offer one, you can adapt that...
    Please Login or Register  to view this content.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  3. #3
    Registered User
    Join Date
    02-23-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    33

    Re: Export two worksheets from a workbook and save with a name

    Do you by any chance know how to import a sheet from

    C:\User\test\Desktop\trial 2001-03-08.xls

    where i want to copy to whole sheet "2011-03-08" into my current workbook. The date is just an example and should be updated so it opens the workbook with todays date and the worksheet with todays date.

  4. #4
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export two worksheets from a workbook and save with a name

    Give this a try:

    Please Login or Register  to view this content.
    Last edited by JBeaucaire; 03-18-2011 at 11:50 AM.

  5. #5
    Registered User
    Join Date
    02-23-2011
    Location
    Stockholm, Sweden
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    33

    Re: Export two worksheets from a workbook and save with a name

    Get stuck on the IF command, get an Type mismatch error

  6. #6
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: Export two worksheets from a workbook and save with a name

    My bad, corrected above.

+ 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