+ Reply to Thread
Results 1 to 7 of 7

Delete adjacent cell

  1. #1
    Forum Contributor
    Join Date
    04-08-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2003
    Posts
    228

    Delete adjacent cell

    Hi,

    please see the .xls attached.

    I have 4 coloumns each with a named range list.

    Titles in Row 1. Contents in Row 2.

    I want it so that whichever of the cells you select then DELETE OR CHANGE then all following cells become empty. If you change C2, then D2 becomes empty. If you change A2, then B2, C2 and D2 become empty.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Delete adjacent cell

    I've added the following macro to your sheet change event code ...

    Please Login or Register  to view this content.

    The updated workbook is attached.
    Attached Files Attached Files

  3. #3
    Forum Contributor
    Join Date
    04-08-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2003
    Posts
    228

    Re: Delete adjacent cell

    That's perfect! Last question, what would I need to change here if I had more than one row? Ie, if I had rows 2,3,4,5 filled in?

  4. #4
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Delete adjacent cell

    Do you want only the cells on the same row as the deleted/updated cell to be cleared?

    If so you could change the code to:

    Please Login or Register  to view this content.

  5. #5
    Forum Expert
    Join Date
    07-20-2011
    Location
    Mysore, India.
    MS-Off Ver
    Excel 2019
    Posts
    8,710

    Re: Delete adjacent cell

    pl see attached file.For sheet1 worksheetchange code added which meets your requirement.
    Regards.
    Attached Files Attached Files

  6. #6
    Forum Contributor
    Join Date
    04-08-2009
    Location
    Bristol, UK
    MS-Off Ver
    Excel 2003
    Posts
    228

    Re: Delete adjacent cell

    Hi kvsrinivasamurthy,

    can you put the code in the thread please? I can't download documents currently.

  7. #7
    Forum Expert
    Join Date
    07-16-2010
    Location
    Northumberland, UK
    MS-Off Ver
    Excel 2007 (home), Excel 2010 (work)
    Posts
    3,054

    Re: Delete adjacent cell

    Quote Originally Posted by kvsrinivasamurthy View Post
    code added which meets your requirement.
    Not wishing to be rude, but you perhaps need to re-read the requirements.

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

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