+ Reply to Thread
Results 1 to 7 of 7

Thread: Copying Select Portions from on WB to another

  1. #1
    Registered User
    Join Date
    12-14-2010
    Location
    USA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Question Copying Select Portions from on WB to another

    I have a massive spreadsheet with information occupying columns A thru T and rows 1 thru 465.

    I need to copy non-adjacent rows using multiple criteria, e.g. row contains "Frederick" or "Daniel" into a new workbook.

    Otherwise, I'll have to do it all manually, which'd take ages.

    Thanks for any help,
    .DJR

  2. #2
    Forum Guru Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,276

    Re: Copying Select Portions from on WB to another

    Its been my experience thus far that if you want something specific from within a worksheet that you need to code the specifics. Eg:
    Cells.Find(what:="Frederick")
    Without seeing what you are wanting to do, non-adjacent rows is a little too vague (non-adjacent to what?). Perhaps if you uploaded a mock workbook you will find the help you require.
    Please leave a message after the beep!

  3. #3
    Registered User
    Join Date
    12-14-2010
    Location
    USA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Re: Copying Select Portions from on WB to another

    In this example, I'd want a script that copies the numbers, jobs, and address info for all the painters and carpenters into a new workbook without touching the Boss or manager.
    Attached Files Attached Files

  4. #4
    Forum Guru Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,276

    Re: Copying Select Portions from on WB to another

    I work with 2003 but check this out to see if it is close to what you want. Run the macro called "copyToSheet2". I had to restructure your sheet a little to do what you want it to do but let me know if I am on the right track here.
    Attached Files Attached Files
    Please leave a message after the beep!

  5. #5
    Registered User
    Join Date
    12-14-2010
    Location
    USA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Thumbs up Re: Copying Select Portions from on WB to another

    That works pretty well (thanks!), but ideally the resulting sheet would have only the rows involved in the macro. i.e. The rows with manager and boss will be blank or only the rows I'm interested are transferred.

    I am curious about the restructuring of the first two columns. Why was that necessary?

    Thanks again!
    DJR
    Last edited by DJRockit; 12-16-2010 at 12:39 AM.

  6. #6
    Registered User
    Join Date
    12-14-2010
    Location
    USA
    MS-Off Ver
    Excel 2008 for Mac
    Posts
    7

    Re: Copying Select Portions from on WB to another

    Here's a better working example file.

    I would like Daniel C's and Mattias A's info transferred to a new sheet without anything else being moved there.
    Attached Files Attached Files

  7. #7
    Forum Guru Mordred's Avatar
    Join Date
    07-06-2010
    Location
    Winnipeg, Canada
    MS-Off Ver
    2007, 2010
    Posts
    2,276

    Re: Copying Select Portions from on WB to another

    Quote Originally Posted by DJRockit View Post
    I am curious about the restructuring of the first two columns. Why was that necessary?

    DJR
    Its just my own habit of having the unique identifiers to compare to in the first column (or row). For me, it makes coding easier to visualize while I'm writing it. I'll look at your workbook throughout today but I have two meetings and a luncheon so I won't be at my desk all day.
    Please leave a message after the beep!

+ 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.2.0