Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Erase Data on Sheet
How can I erase all the cells after row 1 on a worksheet when the sheet opens.
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Erase Data on Sheet
Private Sub Workbook_Open()
Dim ToErase As Range, EraseRows As Integer Set ToErase = Sheets("SheetName").UsedRange EraseRows = ToErase.Rows.Count - 1 If EraseRows 0 Then Set ToErase = ToErase.Offset(1, 0).Range("1:" & EraseRows) ToErase.ClearContents End If End Sub "Bill" wrote: How can I erase all the cells after row 1 on a worksheet when the sheet opens. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Erase Data on Sheet
Bill
You sure you want to do this? Private Sub Worksheet_Activate() Range("A2:IV65536").ClearContents End Sub Gord Dibben Excel MVP On Tue, 25 Jan 2005 14:25:03 -0800, "Bill" wrote: How can I erase all the cells after row 1 on a worksheet when the sheet opens. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
save workbook, erase data but keep formula | Excel Discussion (Misc queries) | |||
why do print range erase in Excel when import data from access | Excel Worksheet Functions | |||
want to erase the 0 | Excel Discussion (Misc queries) | |||
"how to erase data save on excel | New Users to Excel | |||
VB to erase 2 Columns from every sheet | Excel Worksheet Functions |