Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
ClearContents not clearing :( | Excel Programming | |||
Clearcontents | Excel Programming | |||
ClearContents - Except NamedRanges | Excel Programming | |||
Clearcontents | Excel Programming | |||
Clearcontents | Excel Programming |