ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS?

T

traveye

I want to add a button to a cell wich will clear data in a range of cells.
example: click on cell A1 and it will clear data from cell b1 thru b12. Is
this possible?
 
D

Don Guillett

right click sheet tab>view code>insert this. Now when you DOUBLE click cel
a1 b1:b12 cleared

Private Sub Worksheet_BeforeDoubleClick(ByVal Target As Range, Cancel As
Boolean)
If Target.Address = "$A$1" Then Range("b1:b12").ClearContents
End Sub

However, I suspect you did NOT fully state your problem.
 
D

Dave Peterson

range("b1:b2,C17:d99,g13,z:z,105:105").clearcontents

You don't need to select a range to clear it.
 
Top