Clear All Contents from Unprotected Cells Macro

Exceldom

New Member
Joined
Feb 23, 2016
Messages
6
Hi all,

I have a sheet that has many protected cells on it and then to the right of those protect cells are unprotected cells to put our daily usage totals in. After filling out the sheet we print it and then we need to clear the contents within the unprotected cells and start over for the next day.

I need a macro that will just clear the unprotected cells without me having to close the excel sheet and reopen it every time we need to start over.

Haven't been able to find anything specific online to show me how to do this so any help would be appreciated.
 

Excel Facts

Shade all formula cells
To shade all formula cells: Home, Find & Select, Formulas to select all formulas. Then apply a light fill color.
I figured this out. Used this code incase it helps anyone. Just added all the unprotected cells into that list, next line clears the selections, then the next line puts me back into the starting cell. Worked like a charm.

Range("D2,D5,D6,D10:D20,D25:D29,D31,D34,F5:F6,F10:F20,F25:F29,F31,F34,H37:H39,H42:H43").Select
Selection.ClearContents
Range("D2").Select
 
Upvote 0

Forum statistics

Threads
1,214,821
Messages
6,121,759
Members
449,048
Latest member
excelknuckles

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