+ Reply to Thread
Results 1 to 3 of 3

VBA code to clear contents

  1. #1
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    164

    VBA code to clear contents

    Okay, I'm a complete vba novice, so I hope that I'm wording this correct.

    I have a spreadsheet that has two drop downs in an Excel table. In the 4th column (D) and a dependent drop down in the 5th column (E). This is set up and works great, but I would like to add some vba code so that if they change the selection in the 4th column it will also remove the selection (or clear the selection) that was in the 5th column. It's set up in a change event, but I'm not sure how to code it? It's probably pretty easy, but everything I keep finding as an example reference one specific cell, and any contents in the column.

    HTML Code: 
    Any help would be great.

  2. #2
    Forum Expert
    Join Date
    02-14-2009
    Location
    .
    MS-Off Ver
    ................
    Posts
    2,840

    Re: VBA code to clear contents

    Check the column of the changed cell and, if 4, clear the cell to the right (I assume you didn't mean to clear the entire column). This will not affect any Data Validation in the cell in Col 5...
    Please Login or Register  to view this content.

  3. #3
    Forum Contributor
    Join Date
    02-24-2011
    Location
    Los Angeles, CA
    MS-Off Ver
    Office 2010
    Posts
    164

    Re: VBA code to clear contents

    Perfect, thank you so much.

+ 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. VBA Code to clear contents
    By tubbs1969 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 02-19-2016, 10:07 AM
  2. VB Code to clear contents
    By rizmomin in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 07-04-2014, 01:35 AM
  3. Clear contents at start of code
    By Ravenous in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 11-25-2013, 08:39 PM
  4. Code to Clear Contents if values is zero
    By chico.corrales in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 04-19-2013, 08:04 PM
  5. vba code to clear contents of cell
    By codesRus in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-16-2012, 12:16 PM
  6. Code to clear multiple contents
    By ABSTRAKTUS in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 01-24-2012, 02:13 PM
  7. Pop up activated on clear contents code
    By reggie1000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-20-2009, 07:19 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