Skip to content

Instantly share code, notes, and snippets.

View WSwarm's full-sized avatar
😎
Baltimore is open for business!

Balazs WSwarm

😎
Baltimore is open for business!
View GitHub Profile
@scorchio
scorchio / worksheet_clear.vb
Created December 19, 2013 11:12
VBA example code for clearing a worksheet
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