Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default clear the values, but not the formulas in a range

I'm trying to clear the values, but not the formulas in this range?

Range("E3:F3, E5:F5").ClearContents

Is it possible?

Cheers

Aidy

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default clear the values, but not the formulas in a range

Hi

You can use

On Error Resume Next
Range("E3:F3, E5:F5").SpecialCells(xlCellTypeConstants).ClearCon tents
On Error GoTo 0


--
Regards Ron de Bruin
http://www.rondebruin.nl


"aidy" wrote in message ups.com...
I'm trying to clear the values, but not the formulas in this range?

Range("E3:F3, E5:F5").ClearContents

Is it possible?

Cheers

Aidy



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default clear the values, but not the formulas in a range

If a formula evaluates to a value, you can't clear the value without
eliminating the formula. You can hide the value by making the font color
match the background, if that is what you want to do. Or just hide the cells.
--
- K Dales


"aidy" wrote:

I'm trying to clear the values, but not the formulas in this range?

Range("E3:F3, E5:F5").ClearContents

Is it possible?

Cheers

Aidy


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,163
Default clear the values, but not the formulas in a range

Just realized you probably have a mix (unknown to you) of cells with formulas
and values. Try Range("E3:F3,
E5:F5").SpecialCells(xlCellTypeConstants).ClearCon tents.
--
- K Dales


"aidy" wrote:

I'm trying to clear the values, but not the formulas in this range?

Range("E3:F3, E5:F5").ClearContents

Is it possible?

Cheers

Aidy


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 values but keep formulas? Gumby Excel Discussion (Misc queries) 1 June 30th 08 11:13 PM
How do I clear data values wthout losing the formulas? genaksdal Excel Worksheet Functions 1 November 8th 05 05:48 PM
Automatically clear values from a range of selected cells John Davies Excel Discussion (Misc queries) 1 June 28th 05 04:42 PM
Select range -- convert formulas to values Johnny[_9_] Excel Programming 3 June 21st 05 03:40 PM
How do I clear a worksheet of values, but leave formulas intact? [email protected] Excel Worksheet Functions 2 April 18th 05 05:53 PM


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