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

Clearing worksheets also clears the formulas. So does delete. How can I
clear a worksheets without destroying the formulas in the worksheet.

I run macro, edit it then want to run again but with the worksheets
cleared. When I clear them, I have to reenter all the formulas.

JOhn

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Debug Problem

Hi John,

Try:

ActiveSheet.Cells.SpecialCells(xlCellTypeConstants , _
xlNumbers).ClearContents

---
Regards,
Norman



"John" wrote in message
...
Clearing worksheets also clears the formulas. So does delete. How can I
clear a worksheets without destroying the formulas in the worksheet.

I run macro, edit it then want to run again but with the worksheets
cleared. When I clear them, I have to reenter all the formulas.

JOhn



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Debug Problem

That works great, thanks. Now, could I change it so that it worked only
on area selected?

Thanks
John

Norman Jones wrote:

Hi John,

Try:

ActiveSheet.Cells.SpecialCells(xlCellTypeConstants , _
xlNumbers).ClearContents

---
Regards,
Norman



"John" wrote in message
...

Clearing worksheets also clears the formulas. So does delete. How can I
clear a worksheets without destroying the formulas in the worksheet.

I run macro, edit it then want to run again but with the worksheets
cleared. When I clear them, I have to reenter all the formulas.

JOhn





--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Debug Problem

Hi John,

Try:


Selection.SpecialCells(xlCellTypeConstants, _
xlNumbers).ClearContent


---
Regards,
Norman



"John" wrote in message
...
That works great, thanks. Now, could I change it so that it worked only on
area selected?

Thanks
John

Norman Jones wrote:

Hi John,

Try:

ActiveSheet.Cells.SpecialCells(xlCellTypeConstants , _
xlNumbers).ClearContents

---
Regards,
Norman



"John" wrote in message
...

Clearing worksheets also clears the formulas. So does delete. How can I
clear a worksheets without destroying the formulas in the worksheet.

I run macro, edit it then want to run again but with the worksheets
cleared. When I clear them, I have to reenter all the formulas.

JOhn





--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Debug Problem

Selection.SpecialCells(xlCellTypeConstants, _
xlNumbers).ClearContents

--
Regards,
Tom Ogilvy

"John" wrote in message
...
That works great, thanks. Now, could I change it so that it worked only
on area selected?

Thanks
John

Norman Jones wrote:

Hi John,

Try:

ActiveSheet.Cells.SpecialCells(xlCellTypeConstants , _
xlNumbers).ClearContents

---
Regards,
Norman



"John" wrote in message
...

Clearing worksheets also clears the formulas. So does delete. How can I
clear a worksheets without destroying the formulas in the worksheet.

I run macro, edit it then want to run again but with the worksheets
cleared. When I clear them, I have to reenter all the formulas.

JOhn





--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to





  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Debug Problem

Changed to Selection.Cells.SpecialCells(xlCellTypeConstants, _
xlNumbers).ClearContents

And it works perfectly though I have no idea HOW it works.

Thanks

John

Norman Jones wrote:
Hi John,

Try:


Selection.SpecialCells(xlCellTypeConstants, _
xlNumbers).ClearContent


---
Regards,
Norman



"John" wrote in message
...

That works great, thanks. Now, could I change it so that it worked only on
area selected?

Thanks
John

Norman Jones wrote:


Hi John,

Try:

ActiveSheet.Cells.SpecialCells(xlCellTypeConstants , _
xlNumbers).ClearContents

---
Regards,
Norman



"John" wrote in message
. ..


Clearing worksheets also clears the formulas. So does delete. How can I
clear a worksheets without destroying the formulas in the worksheet.

I run macro, edit it then want to run again but with the worksheets
cleared. When I clear them, I have to reenter all the formulas.

JOhn




--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to





--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change
LID to

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5,302
Default Debug Problem

Hi John,

The code is the programmatic equivalent of the manual Steps:

Edit | Go To | Special | check Constants | uncheck all but the Numbers
sub-option | OK | hit the delete key

For further information see VBA help on the SpecialCells method.

I'm pleased you picked up the missing "s" !

---
Regards,
Norman



"John" wrote in message
...
Changed to Selection.Cells.SpecialCells(xlCellTypeConstants, _
xlNumbers).ClearContents

And it works perfectly though I have no idea HOW it works.

Thanks

John

Norman Jones wrote:
Hi John,

Try:


Selection.SpecialCells(xlCellTypeConstants, _
xlNumbers).ClearContent


---
Regards,
Norman



"John" wrote in message
...

That works great, thanks. Now, could I change it so that it worked only
on area selected?

Thanks
John

Norman Jones wrote:


Hi John,

Try:

ActiveSheet.Cells.SpecialCells(xlCellTypeConstants , _
xlNumbers).ClearContents

---
Regards,
Norman



"John" wrote in message
.. .


Clearing worksheets also clears the formulas. So does delete. How can I
clear a worksheets without destroying the formulas in the worksheet.

I run macro, edit it then want to run again but with the worksheets
cleared. When I clear them, I have to reenter all the formulas.

JOhn




--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change LID to





--
R-e-t-u-r-n A-d-d-r-e-s-s I-n-s-t-r-u-c-t-i-o-n-s
Change
LID to



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
DeBug Ollie Excel Discussion (Misc queries) 4 April 28th 06 03:17 PM
help with debug Jim May Excel Programming 2 August 10th 04 01:04 PM
No debug box mushy_peas[_33_] Excel Programming 2 April 23rd 04 12:20 AM
Debug problem James L[_3_] Excel Programming 3 April 7th 04 01:32 PM
debug help Tom Ogilvy Excel Programming 0 August 27th 03 07:10 PM


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