Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 703
Default using button to clear contents

I have finally found out how to add a button but now I am haveing a problem
on having the button clear contents in certain cells does anyone know how to
do this
thanks for your help I do not know any codes for this
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 22,906
Default using button to clear contents

I'll bet you could learn very quickly by using the macro recorder while you
select some cells and editclearcontents.

Here is a sample for a button from the Control Toolbox

Private Sub CommandButton1_Click()
ActiveSheet.Range("certain cells").ClearContents
End Sub

"certain cells" would be your range of cells.


Gord Dibben MS Excel MVP

On Wed, 9 Dec 2009 15:30:26 -0800, Charlie
wrote:

I have finally found out how to add a button but now I am haveing a problem
on having the button clear contents in certain cells does anyone know how to
do this
thanks for your help I do not know any codes for this


  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default using button to clear contents

Just to add to Gord's response.

If you want to clear the contents of the current selection, you could modify the
code to look like:

Private Sub CommandButton1_Click()
Selection.ClearContents
End Sub



Gord Dibben wrote:

I'll bet you could learn very quickly by using the macro recorder while you
select some cells and editclearcontents.

Here is a sample for a button from the Control Toolbox

Private Sub CommandButton1_Click()
ActiveSheet.Range("certain cells").ClearContents
End Sub

"certain cells" would be your range of cells.

Gord Dibben MS Excel MVP

On Wed, 9 Dec 2009 15:30:26 -0800, Charlie
wrote:

I have finally found out how to add a button but now I am haveing a problem
on having the button clear contents in certain cells does anyone know how to
do this
thanks for your help I do not know any codes for this


--

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
Clear Contents gibbylinks Setting up and Configuration of Excel 5 October 12th 09 05:04 PM
Clear Contents Secret Squirrel Excel Discussion (Misc queries) 1 February 3rd 09 12:37 AM
to clear contents of a spreadsheet Jerry Excel Discussion (Misc queries) 2 August 17th 07 02:20 AM
Clear cell contents with a button KFC / A&W Boy Excel Worksheet Functions 1 March 7th 05 09:39 AM
Clear Contents But Not Formula Gancom3 Excel Discussion (Misc queries) 2 February 1st 05 11:30 PM


All times are GMT +1. The time now is 11:35 PM.

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

About Us

"It's about Microsoft Excel"