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

Excel Joke
Why can't spreadsheets drive cars? They crash too often!
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,215,425
Messages
6,124,825
Members
449,190
Latest member
rscraig11

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