Guzzlr
Well-known Member
- Joined
- Apr 20, 2009
- Messages
- 982
- Office Version
- 2021
- Platform
- Windows
Hello all,
Here is my code to clear all my cells to have a blank template to begin again:
The problem is column B retains a number format of "0.00" from when the rest of the program code is run. How can I get column B back to a "General" format?
I do want A8 and B8 to have color replaced, the reason why I have the color code after the special cells code.
Thanks
2013 excel
Here is my code to clear all my cells to have a blank template to begin again:
Code:
Sub ClearContents()
Dim sht As Worksheet
'In case of no numeric formula or constants
On Error Resume Next
'Procedure
For Each sht In ActiveWorkbook.Worksheets
If (sht.Name <> "Instructions") And (sht.Name <> "Revisions") Then
sht.Activate
With Range("A8:AV2000")
.SpecialCells(xlCellTypeConstants).ClearContents
.SpecialCells(xlCellTypeFormulas).ClearContents
.Interior.Pattern = xlNone
Range("A8").Interior.ColorIndex = 6
Range("B8").Interior.ColorIndex = 4
.ColumnWidth = 8.14
End With
End If
Next sht
'Disables any error trapping currently present in the procedure
On Error GoTo 0
'Return to Template Tab
Range("A1").Select
Sheets("Template").Select
End Sub
The problem is column B retains a number format of "0.00" from when the rest of the program code is run. How can I get column B back to a "General" format?
I do want A8 and B8 to have color replaced, the reason why I have the color code after the special cells code.
Thanks
2013 excel
Last edited: