+ Reply to Thread
Results 1 to 8 of 8

Deleting a row by cell value

  1. #1
    Registered User
    Join Date
    02-27-2015
    Location
    Lithuania
    MS-Off Ver
    2010, 2013
    Posts
    26

    Deleting a row by cell value

    Hello,

    I have this piece of code that should delete an entire row according to some cell value.

    Please Login or Register  to view this content.
    The code just goes through and does nothing any help would be appreciated.

  2. #2
    Forum Expert
    Join Date
    01-23-2013
    Location
    USA
    MS-Off Ver
    Microsoft 365 aka Office 365
    Posts
    3,863

    Re: Deleting a row by cell value

    Hi mellowtang,

    I haven't tested the code, but the following line is probably wrong:
    Please Login or Register  to view this content.
    You probably want something like:
    Please Login or Register  to view this content.
    Lewis

  3. #3
    Registered User
    Join Date
    02-27-2015
    Location
    Lithuania
    MS-Off Ver
    2010, 2013
    Posts
    26

    Re: Deleting a row by cell value

    Hey,

    Thanks for your reply. I tried your suggestion but it doesn't do the trick

    mellow

  4. #4
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Deleting a row by cell value

    Can you attach a sample workbook..

    What you want to do can be achieved in a number of ways..

    btw.. how many rows would you typically be working with?

  5. #5
    Registered User
    Join Date
    02-27-2015
    Location
    Lithuania
    MS-Off Ver
    2010, 2013
    Posts
    26

    Re: Deleting a row by cell value

    Thanks for the reply

    I attach the sample workbook with the code that I have by now.

    1. The empty row between the data separates the old data (upper portion) and the new data (lower portion).
    2. Each day I add up to a 100 lines of new data from which I have to delete rows with "NULL" value in column I. This is where the macro comes in.
    3. Then I do some analysis, some other manipulation, delete the empty row and go to make myself a cup of coffee.

    Best,

    mellow

    testbook.xlsm

  6. #6
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Deleting a row by cell value

    Change:

    Please Login or Register  to view this content.
    to:
    Please Login or Register  to view this content.
    You were offsetting to the wrong column...

    In the future.. to debug.. either use the "Watch Window" in the VBEditor.. in this case adding a watch for "Entry.Offset(, 9)" and step through the code (F8).

    Another way is to just hover your cursor over the code as you step through it to see the value.

    Either of these would have shown you that you were offsetting 1 column to far over.

  7. #7
    Registered User
    Join Date
    02-27-2015
    Location
    Lithuania
    MS-Off Ver
    2010, 2013
    Posts
    26

    Re: Deleting a row by cell value

    Damn... I'm such a newb

    Thanks a lot!

  8. #8
    Valued Forum Contributor
    Join Date
    03-22-2013
    Location
    Australia,NSW, Wirrimbi
    MS-Off Ver
    Excel 2013
    Posts
    1,057

    Re: Deleting a row by cell value

    No worries.. you're welcome.. thanks for the Rep.

+ 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. Auto highlight row & column of active cell without deleting existing cell colour
    By claire_wilson in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 10-22-2017, 08:31 PM
  2. Deleting a row of data based on a single cell deletion, and shifting remaining cell up.
    By Dewydecimalpatriot in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-21-2014, 04:05 PM
  3. Replies: 4
    Last Post: 04-11-2012, 08:29 PM
  4. Deleting cell when deleting another
    By learntheweek in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 07-21-2010, 03:54 PM
  5. [SOLVED] how prevent formula in cell from deleting when deleting value????
    By sh-boom in forum Excel - New Users/Basics
    Replies: 1
    Last Post: 09-30-2005, 02:05 PM
  6. Replies: 4
    Last Post: 03-28-2005, 05:06 PM
  7. Replies: 7
    Last Post: 03-27-2005, 08:06 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