+ Reply to Thread
Results 1 to 5 of 5

Would like to copy rows until specific value is found

  1. #1
    Registered User
    Join Date
    07-06-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    45

    Would like to copy rows until specific value is found

    Hi,
    Would like to copy all rows/range to another worksheet, even blank. In this case, all rows before the "1 total" are to copy to group1 sheet, and rows between total 1 and total 2 are to group1 sheet. How to write a code to run this?

    thks&rgds,
    Ann
    Attached Files Attached Files

  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: Would like to copy rows until specific value is found

    Try this:

    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
    07-06-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Would like to copy rows until specific value is found

    Hi JBeaucaire,
    Thanks. You are superb!

    btw, I have longer range to copy, so I changed the range as below, it able to capture the whole range I want, but it wouldn't stop running? As I have total 50 numbers, and it will repeat number 1, after the 50?


    Set Titles = Sheets("Sheet1").Range("A1:Z1")

    Set NumRNG = Intersect(Sheets("Sheet1").Range(Num.Address, Num.End(xlDown).End(xlToRight).Address), Sheets("Sheet1").Range("A:Z"))

    rgds,
    Ann
    Last edited by caooi23; 07-07-2013 at 12:34 AM.

  4. #4
    Registered User
    Join Date
    07-06-2013
    Location
    Malaysia
    MS-Off Ver
    Excel 2010
    Posts
    45

    Re: Would like to copy rows until specific value is found

    Hi JBeaucaire,
    Test again and it runs well. Thanks.

    rgds,
    Ann

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

    Re: Would like to copy rows until specific value is found

    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED. 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