LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Delete cell contents that contain numbers and not formulae ...


Code
-------------------
For Each cell In Range("A1:A5") 'Range is to be set manually or just "ActiveSheet.Cells" for the whole sheet
If Not (cell.HasFormula Or (cell.Value < 0 And cell.Value 9)) Then cell.ClearContents
Next cel
-------------------


It's simple but works :)

Simon
------------------------
Just mentioned that you didn't want to delete text. Have to edit th
code then. So don't use it in the meantime.
------------------------
Ok, the If-Statement had to be edited:

Code
-------------------
If (cell.HasFormula = False) And (IsNumeric(cell.Value)) Then cell.ClearContent
-------------------


;

--
moondar
-----------------------------------------------------------------------
moondark's Profile: http://www.excelforum.com/member.php...fo&userid=2739
View this thread: http://www.excelforum.com/showthread.php?threadid=46987

 
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
delete contents of cell RDC Excel Discussion (Misc queries) 1 January 21st 09 04:13 PM
Delete the contents of all cells which dont contain formulae Warby Excel Discussion (Misc queries) 4 January 14th 08 04:16 PM
How to delete cell values withour deleting cell formulae perfection Excel Discussion (Misc queries) 5 June 18th 07 09:05 PM
How to delete cell values without affecting cell formulae perfection Excel Discussion (Misc queries) 0 June 18th 07 06:55 AM
Delete cell contents Rob[_4_] Excel Discussion (Misc queries) 7 April 10th 07 12:34 PM


All times are GMT +1. The time now is 11:14 PM.

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"