+ Reply to Thread
Results 1 to 4 of 4

VB clearing whole row - only need it to clear two columns please assist

  1. #1
    Registered User
    Join Date
    07-07-2010
    Location
    long beach, california
    MS-Off Ver
    Excel 2003
    Posts
    41

    VB clearing whole row - only need it to clear two columns please assist

    Hello, I am using the following snipped to match values and clear the row in "main". The problem is: I don't want the whole row cleared when a match is found in column E of main. What I want is for only the cells in column E & F to be cleared, not the whole row. Can someone please show me the appropriate tweak?

    Please Login or Register  to view this content.
    thanks in advance
    J

  2. #2
    Forum Guru
    Join Date
    07-25-2011
    Location
    Florida
    MS-Off Ver
    Excel 2003
    Posts
    9,643

    Re: VB clearing whole row - only need it to clear two columns please assist

    Add the bit it red.

    .Rows(i).Range("E1:F1").ClearContents
    Surround your VBA code with CODE tags e.g.;
    [CODE]your VBA code here[/CODE]
    The # button in the forum editor will apply CODE tags around your selected text.

  3. #3
    Forum Contributor
    Join Date
    10-13-2012
    Location
    Southern California
    MS-Off Ver
    Excel 2007
    Posts
    401

    Re: VB clearing whole row - only need it to clear two columns please assist

    How about...

    Please Login or Register  to view this content.

  4. #4
    Registered User
    Join Date
    07-07-2010
    Location
    long beach, california
    MS-Off Ver
    Excel 2003
    Posts
    41

    Re: VB clearing whole row - only need it to clear two columns please assist

    Thank you AlphaFrog! Worked! Thanks Ed_Collins! That one does the trick as well.

    J

+ 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. Clearing formats doesn't clear the background color
    By abbassi in forum Excel General
    Replies: 2
    Last Post: 04-26-2014, 01:06 AM
  2. VBA code to clear the contents (or value) of a cell without clearing the formula
    By BazzaBit in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-10-2013, 08:16 PM
  3. How to clear formula without clearing cell contents
    By prayami in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 01-03-2008, 04:33 AM
  4. Macro to clear cell data without clearing headings
    By DOOGIE in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 07-19-2006, 08:50 AM
  5. [SOLVED] How do I clear a column of data without clearing specific cells?
    By EllenSwarts in forum Excel General
    Replies: 2
    Last Post: 04-05-2006, 12:10 PM
  6. [SOLVED] Clear a worksheet without clearing formulas?
    By doodah in forum Excel General
    Replies: 4
    Last Post: 01-02-2006, 04:59 PM
  7. [SOLVED] How do I clear a column of data without clearing the formulas?
    By EllenSwarts in forum Excel General
    Replies: 2
    Last Post: 03-11-2005, 11:06 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