Modify ClearContents

  • Thread starter Thread starter Saxman
  • Start date Start date
S

Saxman

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.

--
 
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
 
Mike said:
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'.
--
 
Tom said:
Worksheets("Archive").Range("A1:IV500").specialCells(xlConstants).ClearContents

Where exactly do I paste the above in the code and what does IV signify?

Thanks.

--
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top