+ Reply to Thread
Results 1 to 7 of 7

Need macro to copy rows between two defined values

  1. #1
    Registered User
    Join Date
    02-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Question Need macro to copy rows between two defined values

    Good morning!

    I am extremely novice with visual basic and macros, but my boss would like me to figure out a macro for sorting our budget information. Every week, we get an updated list of project budgets, so the rows to copy and paste over always vary. My job is to find the 17 projects relevant to our department and copy and paste the information into a new document. This is an example of how the first few columns look:

    excel.jpg

    I want to run a macro that will find each major project number I'm looking for in column B (corresponding to a number 2 in column A) and copying that row and the rows below it until reaching the next major project number. I'm not sure if that makes sense...

    For example, I would want to find E1007557, select that row and all rows below it until reaching HE310204.

    Is there a way to do this?

    Thank you!
    Last edited by JB87; 02-21-2013 at 01:22 PM.

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,657

    Re: Need macro to copy rows between two defined values

    Here's one example.

    Please Login or Register  to view this content.
    Last edited by AlphaFrog; 02-21-2013 at 01:09 PM.

  3. #3
    Registered User
    Join Date
    02-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need macro to copy rows between two defined values

    Thank you for your response! It doesn't seem to be working for me though - it keeps saying that it can't find the value.

  4. #4
    Registered User
    Join Date
    02-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Question Re: Need macro to copy rows between two defined values

    Can anyone help me with this? I still haven't figured it out!

    Thanks

  5. #5
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need macro to copy rows between two defined values

    What would you want too do with the rows once selected? Move them? Highlight them?

  6. #6
    Registered User
    Join Date
    02-21-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    6

    Re: Need macro to copy rows between two defined values

    I want to copy and paste them to a new sheet

  7. #7
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Need macro to copy rows between two defined values

    Quote Originally Posted by JB87 View Post
    Can anyone help me with this? I still haven't figured it out!

    Thanks
    Would something like this help?

    Please Login or Register  to view this content.

+ 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