+ Reply to Thread
Results 1 to 4 of 4

Using VBA to delete values based on a condition

  1. #1
    Registered User
    Join Date
    04-14-2015
    Location
    Bristol
    MS-Off Ver
    2010
    Posts
    2

    Using VBA to delete values based on a condition

    Hi everyone,

    I'm trying to enter a VBA code that will allow me to delete certain cell values in a column if they are smaller than the corresponding value in another column.

    For example, the values in column C1 and D1 need to be smaller than the value in B1, otherwise their values should be deleted (this continues down all the rows of data).

    Any idea if this is possible?

  2. #2
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Using VBA to delete values based on a condition

    Please Login or Register  to view this content.
    Please click the * below if this helps

  3. #3
    Registered User
    Join Date
    04-14-2015
    Location
    Bristol
    MS-Off Ver
    2010
    Posts
    2

    Re: Using VBA to delete values based on a condition

    Thanks JasperD! Just to check - If I have to extend the number of columns which I'm checking B against, I just increase the number of if lines?

  4. #4
    Forum Expert JasperD's Avatar
    Join Date
    05-07-2013
    Location
    Netherlands
    MS-Off Ver
    Excel 2016
    Posts
    1,393

    Re: Using VBA to delete values based on a condition

    yes, that's correct

+ 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. Delete row based on a condition
    By Yobari in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-19-2015, 06:52 AM
  2. [SOLVED] VBA to delete entire row based on condition met
    By shiva_reshs in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 06-17-2014, 05:48 PM
  3. Delete rows based on more than one condition
    By Steve2107 in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 04-16-2014, 06:16 AM
  4. Delete rows based on condition
    By elocin17 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 01-12-2012, 12:35 PM
  5. Delete a row based on condition
    By vijay2482 in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 12-16-2009, 05:14 AM

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