+ Reply to Thread
Results 1 to 5 of 5

Changing code from deleting rows to cut/paste rows into another sheet and delete blank row

  1. #1
    Registered User
    Join Date
    04-16-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    10

    Changing code from deleting rows to cut/paste rows into another sheet and delete blank row

    The following code was written to delete rows from a workbook completely. The user now wants the deleted rows pasted into another worksheet within the files. I was able to get the data pasted into another worksheet but it left blank rows. I was struggling with a way to delete those rows. I'm sure there is a better way. Here is the original code:

    Please Login or Register  to view this content.
    Please let me know if you need any additional infomation. Thank you in advance for you help!!

    THANKS!
    Kelly

  2. #2
    Registered User
    Join Date
    04-06-2013
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Changing code from deleting rows to cut/paste rows into another sheet and delete blank

    Instead of trying to delete the empty rows, why not just sort what's left?

    All the empties would sort to the bottom. Add in somthing like the following maybe?

    Please Login or Register  to view this content.
    Last edited by Frasterist; 04-18-2013 at 01:11 AM.

  3. #3
    Registered User
    Join Date
    04-16-2013
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2010
    Posts
    10

    Re: Changing code from deleting rows to cut/paste rows into another sheet and delete blank

    Quote Originally Posted by Frasterist View Post
    Instead of trying to delete the empty rows, why not just sort what's left?

    All the empties would sort to the bottom. Add in somthing like the following maybe?

    '
    '
    Cells.Select
    Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, Header:=xlGuess, _
    OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
    DataOption1:=xlSortNormal
    '
    '
    I think I might have to do that. I can't even get the cut/insert rows to work anymore. UGH! I had it yesterday but stupidly deleted the code to try something else - should have commented it out. Rookie mistake, right?

    Now I'm thinking it would be better to cut/paste special values anyway. I'd like to paste them into another worksheet within the same workbook. Any tips??

    THANKS!!

  4. #4
    Registered User
    Join Date
    04-06-2013
    Location
    California
    MS-Off Ver
    Excel 2003
    Posts
    36

    Re: Changing code from deleting rows to cut/paste rows into another sheet and delete blank

    Posting a sample workbook, something to play with, would be nice.

  5. #5
    Forum Expert
    Join Date
    10-06-2008
    Location
    Canada
    MS-Off Ver
    2007 / 2013
    Posts
    5,498

    Re: Changing code from deleting rows to cut/paste rows into another sheet and delete blank

    If you want to delete the rows

    Please Login or Register  to view this content.
    or

    Please Login or Register  to view this content.
    should do it.
    Change the Row and Column references as required and try it on a copy of your workbook.

+ 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