Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify ClearContents
I have a workbook with two worksheets, namely Archive and Data.
The following code clears all the cell in the Archive worsheet when a click event is started. As all cells are cleared, it wipes out any formulae as well! How would I have to modify the code so that it only cleared lines 1 to 500, or certain cells? Sheets("Archive").Select Sheets("Archive").Cells.Select Selection.ClearContents TIA. -- |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify ClearContents
I cann't help with deleting 'certain cells' unless you are specific but this
will delete rows 1 thu 500 Sub deleteme() Sheets("Archive").Select Rows("1:500").Select Selection.ClearContents End Sub "Saxman" wrote: I have a workbook with two worksheets, namely Archive and Data. The following code clears all the cell in the Archive worsheet when a click event is started. As all cells are cleared, it wipes out any formulae as well! How would I have to modify the code so that it only cleared lines 1 to 500, or certain cells? Sheets("Archive").Select Sheets("Archive").Cells.Select Selection.ClearContents TIA. -- |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify ClearContents
Worksheets("Archive").Range("A1:IV500").specialCel ls(xlConstants).ClearContents
-- Regards, Tom Ogilvy "Saxman" wrote: I have a workbook with two worksheets, namely Archive and Data. The following code clears all the cell in the Archive worsheet when a click event is started. As all cells are cleared, it wipes out any formulae as well! How would I have to modify the code so that it only cleared lines 1 to 500, or certain cells? Sheets("Archive").Select Sheets("Archive").Cells.Select Selection.ClearContents TIA. -- |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify ClearContents
Mike wrote:
I cann't help with deleting 'certain cells' unless you are specific but this will delete rows 1 thu 500 Sub deleteme() Sheets("Archive").Select Rows("1:500").Select Selection.ClearContents End Sub ' I get a RunTime error with the above Rows("1:500").Select'. -- |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify ClearContents
Tom Ogilvy wrote:
Worksheets("Archive").Range("A1:IV500").specialCel ls(xlConstants).ClearContents Where exactly do I paste the above in the code and what does IV signify? Thanks. -- |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Modify ClearContents
Saxman wrote:
Tom Ogilvy wrote: Worksheets("Archive").Range("A1:IV500").specialCel ls(xlConstants).ClearContents Where exactly do I paste the above in the code and what does IV signify? I got it woking now! Thanks. -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
clearcontents for some columns of a row | Excel Programming | |||
ClearContents not clearing :( | Excel Programming | |||
Clearcontents | Excel Programming | |||
Clearcontents | Excel Programming | |||
Clearcontents | Excel Programming |