justundertall
New Member
- Joined
- Mar 22, 2021
- Messages
- 21
- Office Version
- 2013
- Platform
- Windows
Good Day,
I have a workbook for doing up estimates based on the info that is put into the Estimate Spreadsheet.
It is currently has a Button with a Macro for Clearing all unlocked cells(yellow cells) which works great, except I have one cell E5(RedCell) which has a macro to create a new estimate number every time the workbook is opened. In order for the Macro in E5 to work it has to be unlocked and always has to have a number in the cell. So when i click on the clear cells button it clears out the E5 cell.
Is there a way to make it clear all the Cells that are unlocked except for E5?
Here is a picture of my spreadsheet then of the clear cells macro
Sub ClearUnlockedCells()
Dim WorkRange As Range
Dim Cell As Range
Set WorkRange = ActiveSheet.UsedRange
For Each Cell In WorkRange
If Cell.Locked = False Then Cell.Value = ""
Next Cell
End Sub
I have a workbook for doing up estimates based on the info that is put into the Estimate Spreadsheet.
It is currently has a Button with a Macro for Clearing all unlocked cells(yellow cells) which works great, except I have one cell E5(RedCell) which has a macro to create a new estimate number every time the workbook is opened. In order for the Macro in E5 to work it has to be unlocked and always has to have a number in the cell. So when i click on the clear cells button it clears out the E5 cell.
Is there a way to make it clear all the Cells that are unlocked except for E5?
Here is a picture of my spreadsheet then of the clear cells macro
Sub ClearUnlockedCells()
Dim WorkRange As Range
Dim Cell As Range
Set WorkRange = ActiveSheet.UsedRange
For Each Cell In WorkRange
If Cell.Locked = False Then Cell.Value = ""
Next Cell
End Sub