+ Reply to Thread
Results 1 to 7 of 7

Delete Additional Rows

  1. #1
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Delete Additional Rows

    I'm using this piece of code (as part of a macro) to delete rows 28 to 62 when the values in column F are zero. In addition to this, I want to be able to also delete rows 20 to 27, when the value in C22 is "-". Is there a way to achieve this bearing in mind that not all rows in the range C20:C27 will show "-" ?

    Please Login or Register  to view this content.
    Many thanks
    Attached Files Attached Files
    Thanks,
    HangMan

    You can say "Thank you!" by clicking Add Reputation below the post.
    Please, mark your thread [SOLVED] if you are happy with the solution.

  2. #2
    Forum Expert mrice's Avatar
    Join Date
    06-22-2004
    Location
    Surrey, England
    MS-Off Ver
    Excel 2013
    Posts
    4,967

    Re: Delete Additional Rows

    Maybe

    Please Login or Register  to view this content.

  3. #3
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Delete Additional Rows

    Maybe:

    Please Login or Register  to view this content.
    If I've helped you, please consider adding to my reputation - just click on the liitle star at the left.

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~(Pride has no aftertaste.)

    You can't do one thing. XLAdept

    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~aka Orrin

  4. #4
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Delete Additional Rows

    Hi Martin,

    However much I adjusted the row number in the code I couldn't delete row 20! Not sure what I am doing wrong...

  5. #5
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Delete Additional Rows

    Hi xladept

    That worked perfectly and does delete row 20... still unsure why I couldn't do that with Martin's code, but all working I think!

    Many thanks

  6. #6
    Forum Guru xladept's Avatar
    Join Date
    04-14-2012
    Location
    Pasadena, California
    MS-Off Ver
    Excel 2003,2010
    Posts
    12,378

    Re: Delete Additional Rows

    You're welcome, I can't imagine why Martin's code didn't work, except if you ran it before the other deletions

  7. #7
    Forum Contributor
    Join Date
    06-21-2010
    Location
    -
    MS-Off Ver
    Excel 2010
    Posts
    1,211

    Re: Delete Additional Rows

    No, I ran it in the same place as your code, kept adjusted the row references but couldn't get row 20 to delete. It will be because it's late and I've been staring at this for too long. I'm sure it does work, it's just me

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] VBA macro, move cell contents, duplicate down if additional value, delete empty rows
    By lengwer in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-07-2015, 10:46 AM
  2. [SOLVED] New Question to Hide Rows with Toggle button and auto adjust for additional rows
    By The Phoenix in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 07-14-2015, 01:55 PM
  3. Replies: 4
    Last Post: 03-05-2014, 02:40 AM
  4. Excel 2007 : adding additional rows
    By ccinorth in forum Excel General
    Replies: 1
    Last Post: 08-02-2011, 08:52 AM
  5. Deleting additional rows
    By Venkoba in forum Excel General
    Replies: 2
    Last Post: 10-05-2006, 03:34 AM
  6. prevent additional rows
    By accesspro in forum Excel General
    Replies: 2
    Last Post: 03-10-2006, 10:10 PM
  7. How do I delete or remove additional blank pages of a worksheet?
    By Kim in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 10-27-2005, 04:05 PM

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