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

To make 'Empty' cells I expected this to work:

Worksheets("Sheet1").Range("F1:F15").ClearContents

.... but it does nothing... does not even clear numbers in those cells.
Do I need to use another method for this purpose ?


Thank's,
Kjartan


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 42
Default ClearContents does not work...

hi kjartan....
yes the code you have is ok....it works...
1 questions:
are you running this one in the workbook you want to "clearcontents"

if you donÂīt you have to put:
workbooks("workbookname").Worksheets("Sheet1").Ran ge("F1:F15").ClearContents

cheers
Miguel

"Kjartan" wrote:

To make 'Empty' cells I expected this to work:

Worksheets("Sheet1").Range("F1:F15").ClearContents

.... but it does nothing... does not even clear numbers in those cells.
Do I need to use another method for this purpose ?


Thank's,
Kjartan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ClearContents does not work...

Miguel,
Thank you for your reply.
My code is in a module. Adding the Workbookname did not work either...

"Liedson31" wrote in message
...
hi kjartan....
yes the code you have is ok....it works...
1 questions:
are you running this one in the workbook you want to "clearcontents"

if you donīt you have to put:
workbooks("workbookname").Worksheets("Sheet1").Ran ge("F1:F15").ClearContents

cheers
Miguel

"Kjartan" wrote:

To make 'Empty' cells I expected this to work:

Worksheets("Sheet1").Range("F1:F15").ClearContents

.... but it does nothing... does not even clear numbers in those cells.
Do I need to use another method for this purpose ?


Thank's,
Kjartan





  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default ClearContents does not work...

I feel dum now :(... My code just needed to be inside the proper sheet... It
works fine now...

"Kjartan" wrote in message
...
Miguel,
Thank you for your reply.
My code is in a module. Adding the Workbookname did not work either...

"Liedson31" wrote in message
...
hi kjartan....
yes the code you have is ok....it works...
1 questions:
are you running this one in the workbook you want to "clearcontents"

if you donīt you have to put:
workbooks("workbookname").Worksheets("Sheet1").Ran ge("F1:F15").ClearContents

cheers
Miguel

"Kjartan" wrote:

To make 'Empty' cells I expected this to work:

Worksheets("Sheet1").Range("F1:F15").ClearContents

.... but it does nothing... does not even clear numbers in those cells.
Do I need to use another method for this purpose ?


Thank's,
Kjartan







  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default ClearContents does not work...

You will need to show more of your code, then, to see what is happening. I
suspect your code never even hits this line. Is it inside a loop or an If
statement? Perhaps the conditions are not met to get the loop or the If
statement to run.

"Kjartan" wrote:

Miguel,
Thank you for your reply.
My code is in a module. Adding the Workbookname did not work either...

"Liedson31" wrote in message
...
hi kjartan....
yes the code you have is ok....it works...
1 questions:
are you running this one in the workbook you want to "clearcontents"

if you donÂīt you have to put:
workbooks("workbookname").Worksheets("Sheet1").Ran ge("F1:F15").ClearContents

cheers
Miguel

"Kjartan" wrote:

To make 'Empty' cells I expected this to work:

Worksheets("Sheet1").Range("F1:F15").ClearContents

.... but it does nothing... does not even clear numbers in those cells.
Do I need to use another method for this purpose ?


Thank's,
Kjartan








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default ClearContents does not work...

The original code worked fine for me and there is no reason is shouldn't
work. It is the correct syntax and the correct command. Test it by opening
only a single new workbook. then put some values in Sheet1!F1:F15. Now do
Alt+F11 and insert a new module.

Put in code like

Sub AAA()
Worksheets("Sheet1").Range("F1:F15").ClearContents
end Sub

Run the macro. It should work as you would expect.

--
Regards,
Tom Ogilvy

"Kjartan" wrote in message
...
Miguel,
Thank you for your reply.
My code is in a module. Adding the Workbookname did not work either...

"Liedson31" wrote in message
...
hi kjartan....
yes the code you have is ok....it works...
1 questions:
are you running this one in the workbook you want to "clearcontents"

if you donīt you have to put:

workbooks("workbookname").Worksheets("Sheet1").Ran ge("F1:F15").ClearContents

cheers
Miguel

"Kjartan" wrote:

To make 'Empty' cells I expected this to work:

Worksheets("Sheet1").Range("F1:F15").ClearContents

.... but it does nothing... does not even clear numbers in those cells.
Do I need to use another method for this purpose ?


Thank's,
Kjartan







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
ClearContents not clearing :( JoeH[_21_] Excel Programming 0 September 27th 04 02:54 AM
Clearcontents Caroline Vincent Excel Programming 2 September 9th 04 11:03 AM
ClearContents - Except NamedRanges Mike Fogleman Excel Programming 8 September 2nd 04 01:19 AM
Clearcontents K Dales Excel Programming 0 February 27th 04 01:52 PM
Clearcontents Dick Kusleika[_3_] Excel Programming 0 February 17th 04 05:42 PM


All times are GMT +1. The time now is 04:20 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"