+ Reply to Thread
Results 1 to 3 of 3

Delete range if column contains

  1. #1
    Registered User
    Join Date
    09-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    10

    Delete range if column contains

    Hi,

    I am wondering how I can enter the following task in VBA: if cell
    Px = 0, clear contents in Lx to Sx.

    I tried doing this without VBA using a simple if-then statement, however, I need the contents of the cell to be absolutely cleared because the range will be imported into another worksheet where all blank rows will be deleted. And unless cleared, excel still recognizes something in the cells.

    Thanks!

  2. #2
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Delete range if column contains

    Maybe:

    Something like this?

    Please Login or Register  to view this content.

  3. #3
    Forum Moderator - RIP Richard Buttrey's Avatar
    Join Date
    01-14-2008
    Location
    Stockton Heath, Cheshire, UK
    MS-Off Ver
    Office 365, Excel for Windows 2010 & Excel for Mac
    Posts
    29,464

    Re: Delete range if column contains

    Hi,

    Please Login or Register  to view this content.
    Modify the 'Sheet1' name as necessary
    Richard Buttrey

    RIP - d. 06/10/2022

    If any of the responses have helped then please consider rating them by clicking the small star icon below the post.

  4. #4
    Registered User
    Join Date
    09-29-2013
    Location
    United States
    MS-Off Ver
    Excel 2007
    Posts
    10

    Re: Delete range if column contains

    Richard, that looks like what I'm looking for, except when I use it in my macro I get the run time error 424, object required. Any idea? I have changed the sheet1 to the name of mine. Thank u.

+ 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] How to delete ShiftUp range B:L when column K = EA but either J or L are blank
    By tuongtu3 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-05-2013, 03:53 AM
  2. Delete on Search macro needs to run on used range of column
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 01-23-2012, 10:45 AM
  3. Delete on Search macro needs to run on used range of column
    By farrukh in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 01-23-2012, 07:47 AM
  4. How can I delete a date range in a column
    By nv_ram82 in forum Excel General
    Replies: 1
    Last Post: 03-01-2010, 07:46 AM
  5. If Value in Range then Delete Column
    By Ozbobeee in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 11-25-2005, 01:45 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