Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Error of ClearContents

Hi,

I use ClearContents to reset data before take my calculation on a hidden
worksheet. however, the code is get same error.

Private Sub CommandButton1_Click()
Sheets("Sheet2").Cells.ClearContents
End Sub

Run-time error '1004':

ClearContents method of Range class failed

Can someone help me with this?


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default Error of ClearContents

If you're using XL97, you need to set the button's TakeFocusOnClick
property to False.

In article ,
"Richard" wrote:

Hi,

I use ClearContents to reset data before take my calculation on a hidden
worksheet. however, the code is get same error.

Private Sub CommandButton1_Click()
Sheets("Sheet2").Cells.ClearContents
End Sub

Run-time error '1004':

ClearContents method of Range class failed

Can someone help me with this?


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
Sheets("Sheet1").Cells.ClearContents Seeker Excel Discussion (Misc queries) 2 October 1st 09 12:00 PM
"ClearContents" command halts code Dave O Excel Discussion (Misc queries) 3 January 10th 08 03:39 PM
Conditional formatting, pastevalues, clearcontents Allllen Excel Discussion (Misc queries) 2 August 30th 06 05:09 PM
ClearContents method on a passed range bryan New Users to Excel 2 January 19th 05 08:49 AM
code to clearcontents of "0" values in cells friesianet Excel Programming 1 September 12th 03 03:58 PM


All times are GMT +1. The time now is 08:40 AM.

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"