Excel - Clear the contents of specific cells

April 2018




Issue


I have 6 cells with dropdowns list and they are selected each time. I wish I could have a reset button for the last entry for 6 cells(to clear them) but of course keeping the other items in my lists untouched.

Solution


Here is a code to erase your cells maintaining lists of validations


Private Sub CommandButton1_Click()  
[A14:F14].ClearContents  
End Sub 

Notes


Thanks to Mike-31 for this tip.
Published by jak58. Latest update on December 7, 2011 at 09:47 AM by jak58.
This document, titled "Excel - Clear the contents of specific cells," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (https://ccm.net/).
Excel - Countif formula issue
Excel - Retrieve data selectively from cells