+ Reply to Thread
Results 1 to 6 of 6

Cut and paste entire row into new worksheet based on cell value

Hybrid View

  1. #1
    Registered User
    Join Date
    04-17-2012
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Cut and paste entire row into new worksheet based on cell value

    Let me start by saying my VBA skills are at best very limited!

    I have a large worksheet entitled Master List with over 1000 rows of data and "U" columns, with new rows being added on a daily basis by a number of individual users.

    In Column R there is there is a status option of "OPEN" or "CLOSED" (all cells are filled)
    I would like to assign a macro to a button which cuts and pastes all the "CLOSED" rows onto a new worksheet entitled CLOSED maintaining the column headers if possible. Also, to avoid gaps in the first worksheet delete the now empty rows.

    The purpose of the macro is for myself to easily seperate the OPEN and CLOSED data, as only the OPEN entries need attention.

    I have been looking around for code for this problem but am struggling a bit, "an idiots guide to...." would be most appreciated.

    I am very new to forums, so if i have missed any necessary information please let me know.

    Thanks,
    Joe

  2. #2
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Cut and paste entire row into new worksheet based on cell value

    Hi
    Upload the sample file..
    Click *, if my suggestion helps you. Have a good day!!

  3. #3
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Cut and paste entire row into new worksheet based on cell value

    Hi
    Check out this. But there is one problem. When the closed entry is cut and pasted into the "Closed" sheet, what abt the blank rows that will be formed in "Master List" sheet? Pls clear this... Also check the cut and paste operation..

    cutpastedata.xlsm

    Regards

  4. #4
    Registered User
    Join Date
    04-17-2012
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Cut and paste entire row into new worksheet based on cell value

    thanks that sample code works, but as you mentioned there are now blanks in the master list where the "closed" actions were cut.

    is there a way for these to be removed by the same macro after the closed actions are cut?

    also, when there is no "CLOSED" lines of data on the Master List when i run the macro then i get an error message run-time error '9': subscript out of range, could this be prevented and possibly a message box to say "no CLOSED actions found" could pop up instead?
    Last edited by langle_j; 04-17-2012 at 08:28 AM.

  5. #5
    Registered User
    Join Date
    04-17-2012
    Location
    Portsmouth, England
    MS-Off Ver
    Excel 2003
    Posts
    3

    Re: Cut and paste entire row into new worksheet based on cell value

    i have figured out how to remove the empty cells so do not worry about that, just the problem of the error message now!

  6. #6
    Valued Forum Contributor
    Join Date
    02-09-2012
    Location
    Mauritius
    MS-Off Ver
    Excel 2007
    Posts
    1,055

    Re: Cut and paste entire row into new worksheet based on cell value

    Try this modified code:

    cutpastedata.xlsm

+ 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