+ Reply to Thread
Results 1 to 6 of 6

Delete certain columns instead of entire row

  1. #1
    Registered User
    Join Date
    11-15-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    54

    Delete certain columns instead of entire row

    I have a macro that detects duplicates and deletes the entire row. My question is, is there a way to only delete certain columns in that row?
    Please Login or Register  to view this content.

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

    Re: Delete certain columns instead of entire row

    This clears cells C and D in the row.

    Rows(x).Range("C1:D1").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 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 certain columns instead of entire row

    Hi,

    Do you really mean delete certain cells in that row since the concept of deleting certain columns in a row without also deleting those same columns in other rows is new to me?

    Perhaps you mean delete the value in a certain cell by shuffling all the other cells on that row across by one?
    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
    Forum Expert
    Join Date
    06-12-2012
    Location
    Ridgefield Park, New Jersey
    MS-Off Ver
    Excel 2003,2007,2010
    Posts
    10,241

    Re: Delete certain columns instead of entire row

    Do you mean Columns or cells in that row. This will delete Columns on each occurance of greater than 1?

    Please Login or Register  to view this content.
    Not sure this is what you want though.

  5. #5
    Registered User
    Join Date
    11-15-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Delete certain columns instead of entire row

    Sorry for the confusion, yes I mean deleting only certain cells in that row. Cells A,B,C,D

  6. #6
    Registered User
    Join Date
    11-15-2013
    Location
    Ohio
    MS-Off Ver
    Excel 2013
    Posts
    54

    Re: Delete certain columns instead of entire row

    AlphaFrog

    That worked well thank you all for the speedy response I will mark this thread as solved

+ 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] If multiple columns are blank, delete entire row
    By steven_e in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-11-2013, 04:18 PM
  2. [SOLVED] Delete entire Columns based on different Headers (Array)
    By WITJ in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 05-13-2013, 02:46 PM
  3. Delete entire columns if two criteria are met
    By duugg in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 06-22-2009, 11:17 AM
  4. Macro to delete entire rows based values in columns
    By shamade2107 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-13-2009, 11:17 AM
  5. Delete an entire Row if 2 Columns = Zero Q
    By John in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-23-2005, 02: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