+ Reply to Thread
Results 1 to 6 of 6

VBA Code that creates new workbook that has 2 sheets and auto save

Hybrid View

  1. #1
    Registered User
    Join Date
    12-07-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    VBA Code that creates new workbook that has 2 sheets and auto save

    My workbook has two workseets that I need to split by an area and then save each new workbook under the areas name. Before anyone says combine the two sheets to make it easier we can't; we have to have 2 separate sheets for this particualr report

    Start File:
    Sample.xls
    This is the file that contains all of the data compiled together on two separate worksheets.
    Worksheet 1
    Fields: Area, Name, Score
    Area 31, Joe, 5
    Area 31 Jane, 20
    Area 33, John, 44
    Area 52, Mike, 3
    Worksheet 2
    Fields: Area, Name, Rating
    Area 31, Joe, Fail
    Area 31, Jane, Pass
    Area 33, John, Pass
    Area 52, Mike, Pass
    End result of Macro:
    Based on sample file the output would be 3 separate files. Each contains both workseets for that particular area. See example below:
    Area 31 Results.xls
    Worksheet 1
    Fields: Area, Name, Score
    Area 31, Joe, 5
    Area 31 Jane, 20
    Worksheet 2
    Fields: Area, Name, Rating
    Area 31, Joe, Fail
    Area 31, Jane, Pass
    Area 33 Results.xls
    Worksheet 1
    Fields: Area, Name, Score
    Area 33, John, 44
    Worksheet 2
    Fields: Area, Name, Rating
    Area 33, John, Pass
    Area 52 Results.xls
    Worksheet 1
    Fields: Area, Name, Score
    Area 52, Mike, 3
    Worksheet 2
    Fields: Area, Name, Rating
    Area 52, Mike, Pass
    I would need both Worksheet 1 and 2 on a new workbook grouped by the areas and called by the area name. Ex "Area 31 Results" then the next would be "Area 33 Results", "Area 52 Results", etc

    I have also attached a sample file. On there I would need to keep the headers as is, the drop downs in column F and G with their choices and set the print area around columns A - H on worksheet 1 and columns A - D on worksheet 2 including the data for that area and have it print in landscape. There is more data to these reports - this is just a simplified example
    Attached Files Attached Files
    Last edited by jasmin1279; 12-08-2010 at 10:17 AM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA Code that creates new workbook that has 2 sheets and auto save

    Hello jasmin1279,

    Welcome to the Forum!

    It would also help to see an example of the end result..
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Registered User
    Join Date
    12-07-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA Code that creates new workbook that has 2 sheets and auto save

    Thanks for the tip. Added what the sample ouput should be like in originial post...

  4. #4
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,259

    Re: VBA Code that creates new workbook that has 2 sheets and auto save

    Hello jasmin1279,

    Thanks for posting the output. My version of what the output would look like wasn't even close!

  5. #5
    Registered User
    Join Date
    12-07-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA Code that creates new workbook that has 2 sheets and auto save

    sure thing.

    Bumping it up

  6. #6
    Registered User
    Join Date
    12-07-2010
    Location
    Virginia
    MS-Off Ver
    Excel 2007
    Posts
    4

    Re: VBA Code that creates new workbook that has 2 sheets and auto save

    still looking for an answer on this....anyone have any tips on how to complete?

+ 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