Excel - Clear the contents of specific cells

November 2016




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.

Related :

This document entitled « Excel - Clear the contents of specific cells » from CCM (ccm.net) is made available under the Creative Commons license. You can copy, modify copies of this page, under the conditions stipulated by the license, as this note appears clearly.