Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS?

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?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,101
Default ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS?

From the forms toolbox put a button on your sheet and when the popup window
comes up click on new macro and add the following code.

Range("B1:B12").Select
Selection.ClearContents

Mike

"traveye" wrote:

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?

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 10,124
Default ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS?

right click sheet tabview codeinsert 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.

--
Don Guillett
SalesAid Software

"traveye" wrote in message
...
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?



  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 9
Default ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS?

Thanks, it works great!

"Mike" wrote:

From the forms toolbox put a button on your sheet and when the popup window
comes up click on new macro and add the following code.

Range("B1:B12").Select
Selection.ClearContents

Mike

"traveye" wrote:

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?

  #5   Report Post  
Posted to microsoft.public.excel.misc
dow dow is offline
external usenet poster
 
Posts: 7
Default ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS?

How Can I do that for multiple cells that are not contiguous. I am a novice.
--
dow


"Mike" wrote:

From the forms toolbox put a button on your sheet and when the popup window
comes up click on new macro and add the following code.

Range("B1:B12").Select
Selection.ClearContents

Mike

"traveye" wrote:

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?



  #6   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default ADD A BUTTON TO A CELL TO DELETE A RANGE OF CELLS?

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

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

dow wrote:

How Can I do that for multiple cells that are not contiguous. I am a novice.
--
dow

"Mike" wrote:

From the forms toolbox put a button on your sheet and when the popup window
comes up click on new macro and add the following code.

Range("B1:B12").Select
Selection.ClearContents

Mike

"traveye" wrote:

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?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Can a cell refer to a Range of cells? Courreges Excel Discussion (Misc queries) 3 June 13th 06 03:25 PM
How do I total range of cells that have checks in checkboxes? instructorjml Excel Discussion (Misc queries) 2 March 23rd 06 11:56 AM
UDF is updateing cells on another sheet with count from current sheet. John Excel Discussion (Misc queries) 3 March 20th 06 03:58 PM
Copy/Paste how to avoid the copy of formula cells w/o calc values Dennis Excel Discussion (Misc queries) 10 March 2nd 06 10:47 PM
copying cell names Al Excel Discussion (Misc queries) 12 August 11th 05 03:01 PM


All times are GMT +1. The time now is 02:12 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"