Reset Button to clear cell value and not cell formatting

mikeb7500

Board Regular
Joined
Jul 30, 2014
Messages
99
On a form I developed, these cells are formatted with a border, color and a drop-down list. I created a RESET BUTTON to clear these cells, but when you press the reset button it also clears the border, color, and the drop-down list. not just the value in the cell.

What code can I use to JUST to only clear the value back to zero in each cell, which is the first option in my drop-down lists?

Also, I would like this reset button to work in a protected worksheet if possible. Any ideas? Thanks!


Sub Clearcells()
Range("G1").Clear
Range("E3").Clear
Range("C4").Clear
Range("C5").Clear
Range("C5").Clear
Range("D7").Clear
Range("C5").Clear
Range("F6").Clear
Range("G5").Clear
Range("E8").Clear
Range("I9").Clear
End Sub
 

Excel Facts

Why are there 1,048,576 rows in Excel?
The Excel team increased the size of the grid in 2007. There are 2^20 rows and 2^14 columns for a total of 17 billion cells.
How about
Code:
Sub Clearcells()
   ActiveSheet.Unprotect "Pword"
   Range("C4:C5,D7,E3,E8,F6,G1,G5,I9").ClearContents
   ActiveSheet.Protect "Pword"
End Sub
 
Upvote 0
Glad we could help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,223,710
Messages
6,174,019
Members
452,542
Latest member
Bricklin

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top