+ Reply to Thread
Results 1 to 3 of 3

VBA extract X number of rows and save as new workbook

  1. #1
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    VBA extract X number of rows and save as new workbook

    Hi Guys.

    Please find example sheet attached.

    I've been trying to make a macro which will do the following:

    Copy first 3 rows (headers)

    Look at name in Column I.

    Copy all rows which have this contact as a value ALSO copy total data beneath each group (5 rows under last entry)


    Paste header to new workbook.
    Paste copied rows to new workbook
    Save workbook as Value in Column I

    Any help would be appreciated guys, I'm having trouble making VB identify how many rows for each name there are...


    Many thanks

    F
    Attached Files Attached Files
    Last edited by freud1; 05-09-2012 at 06:04 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: VBA extract X number of rows and save as new workbook

    This should do it, be sure to edit the fPATH string before running the macro on your data:

    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
    Forum Contributor
    Join Date
    06-13-2008
    Location
    London, England
    MS-Off Ver
    2010
    Posts
    277

    Re: VBA extract X number of rows and save as new workbook

    SPOT ON JERRY!

    you save my bacon once again!

    Eternal thanks!

+ 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