+ Reply to Thread
Results 1 to 5 of 5

Select cells, then copy those rows to new sheet

  1. #1
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Select cells, then copy those rows to new sheet

    Greetings again, Gurus. I'm always amazed by the assistance you guys offer, and I can't thank you enough.

    I'm trying to create a macro that will allow the user to select a range of cells, (in column V in the attached sample), and then insert a new worksheet and copy the entire row where the user selected the cells to that worksheet.

    For example: (I've deleted most of the data from the sample)
    The user want to create an order that has an exteded cube of 300 feet. By holding the "Ctrl" key down, they could pick and choose the parts they want to add, until the sum in Excel shows nearly 300.00 extended cube. They would then run the macro, which would copy only the rows which the user has selected in column V to the new worksheet.

    I hope the attached sample will help explain what I mean, but let me know if I've confused you.

    Thanks in advance for any help you can offer.

    Edit: I thought about it right after posting. It may be better to have the user run the macro first, and it would tell the user to select the cells to copy. The important thing is that they only have to select the cell in column V, so they cna see the sum of the cube while they are selecting. Just a thought.
    Attached Files Attached Files
    Last edited by [email protected]; 12-10-2009 at 02:19 PM.

  2. #2
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Select cells, then copy those rows to new sheet

    Like so?
    Please Login or Register  to view this content.

  3. #3
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Select cells, then copy those rows to new sheet

    Thanks for the reply, Stephen.

    That's close, but there are a couple of issues.

    My biggest problem is I noticed that Excel doesn't give you the accumulated sum at the bottom of the window when you are selecting while in a macro. Unless there is a way to use VBA to show a total cube selected while selecting the cells, then we may need to go back to selecting the cells before running the macro. The primary goal is to allow the user to select how many cubic feet they are putting on an order, so I need to figure out how to display the cube data while selecting.

    It would be easy to adapt your code to copy the cells that have already been selected. This seems to work:
    Please Login or Register  to view this content.
    I can incorporate that into my macro, unless you know of a better way to display the cube while being selected.

    Thanks for all your help.

  4. #4
    Forum Guru
    Join Date
    08-26-2007
    Location
    London
    Posts
    4,606

    Re: Select cells, then copy those rows to new sheet

    I think that's probably the simplest thing - perhaps you could introduce a bit of error-trapping as below?
    Please Login or Register  to view this content.

  5. #5
    Valued Forum Contributor
    Join Date
    03-23-2008
    Location
    Tennessee
    MS-Off Ver
    Office 2007
    Posts
    706

    Re: Select cells, then copy those rows to new sheet

    Agreed. And thanks for the error trapping suggestions. I'll incorporate those as well.

    Have a good one!

+ 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