To Clear number in the cell(s)

  • Thread starter Thread starter Soth
  • Start date Start date
S

Soth

Hi -

I'm interested in clearing cell's number using a 'button', will macro
program work?
I'm not sure how to begin.

For Example:

A Press a 'Button' will clear all number
in column A.
$10
$20
$30
Total $60

Thanks,
Soth
 
Is the Total in A4 a formula you want to keep and delete the numbers in
A1:A3?

Simply select and delete A1:A3

Or select column A and F5>Special>Constants>OK

Edit>Delete

Record a macro whilst doing this if you want a macro.


Gord Dibben MS Excel MVP
 
Mike -

I'm constantly changing numbers and I don't like to highlight all cell and
delete, but rather press a button to clear at once.

Sothea
 
Hi,

it seems like overkill to me but put a button on your sheet, I used the
FORMS toolbax and enter this code. It will clear the column with the active
cell in. If it's always column A use

Sub Button1_Click()
ActiveCell.EntireColumn.ClearContents
End Sub

If it's always column A use

Sub Button1_Click()
Columns(1).ClearContents
End Sub

Mike
 
Sub clearnums()
With ActiveSheet.UsedRange
.SpecialCells(xlCellTypeConstants, 1).ClearContents
End With
End Sub

Assign to a button.


Gord
 
What about protecting all the other cells in the workbook (that you don't
want to clear), then selcting the entire worksheet and deleing?
 
Back
Top