Created
December 19, 2013 11:12
-
-
Save scorchio/8037669 to your computer and use it in GitHub Desktop.
VBA example code for clearing a worksheet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sub ClearSheet() | |
Dim sheetToClear As Worksheet | |
Set sheetToClear = ActiveSheet ' Replace this with the sheet reference | |
' Delete something specific... | |
' sheetToClear.Cells.ClearFormats | |
' sheetToClear.Cells.ClearContents | |
' sheetToClear.Cells.ClearHyperlinks | |
' ...or every kind of data in the cells | |
sheetToClear.Cells.Clear | |
End Sub |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Nice, thank you!