+ Reply to Thread
Results 1 to 5 of 5

deleting specific rows or columns

  1. #1
    Registered User
    Join Date
    02-26-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    40

    Smile deleting specific rows or columns

    I have some code built to delete specific rows of data. It starts at the bottom of the document and moves up. It will do the first delete fine but then errors on the next line. Am i missing something between each delete command?

    Please Login or Register  to view this content.
    Last edited by Mick S; 04-20-2011 at 10:27 PM.

  2. #2
    Forum Moderator Leith Ross's Avatar
    Join Date
    01-15-2005
    Location
    San Francisco, Ca
    MS-Off Ver
    2000, 2003, & 2010
    Posts
    23,258

    Re: deleting specific rows or columns

    Hello Mick S,

    What error number do you get?
    Sincerely,
    Leith Ross

    Remember To Do the Following....

    1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.
    2. Thank those who have helped you by clicking the Star below the post.
    3. Please mark your post [SOLVED] if it has been answered satisfactorily.


    Old Scottish Proverb...
    Luathaid gu deanamh maille! (Rushing causes delays!)

  3. #3
    Valued Forum Contributor jwright650's Avatar
    Join Date
    12-10-2010
    Location
    Va, USA
    MS-Off Ver
    Excel 2003, Excel 2010
    Posts
    606

    Re: deleting specific rows or columns

    Once you delete row 173:500, a new set of rows becomes rows 173:500...so how does it get out of that senerio?
    Life is like a roll of toilet paper. The closer it gets to the end, the faster it goes.
    John Wright

  4. #4
    Registered User
    Join Date
    02-26-2011
    Location
    USA
    MS-Off Ver
    Excel 2010
    Posts
    40

    Re: deleting specific rows or columns

    @ Leith Ross
    The error code i get is

    Run Time error '1004':
    Method 'Range of object'_worksheet failed

    @jwright650
    I thought about that and that is why i started at the bottom and moved my way up. That way the row numbers that are being deleted are always the same.

  5. #5
    Forum Contributor
    Join Date
    07-29-2008
    Location
    New York
    MS-Off Ver
    Excel 2003 & 2007
    Posts
    145

    Re: deleting specific rows or columns

    Mick S,
    Change "range" to "rows" and start from the last row:

    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)

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