Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Deleting Many Cells on a Sheet

I am using Excel 2002 and have a sheet which Ranges from E5:O78.
There are 20 ranges like E5:F18, H5:F18 etc which has only input info as in
a time sheet.
I need to delete the info with a macro but need to keep the Formulas outside
these Ranges
intact. I have been successfully using:
ActiveSheet.Unprotect
Range("E5:F18,H5:I18,K5:L18,etc................... .).ClearContents
ActiveSheet.Protect
but the formula length become unwieldy with 20 Ranges to clear, is there one
Formula which
will only delete non formula cells?
Many thanks
Jim


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Deleting Many Cells on a Sheet

Select the range E5:L18 for example
Press F5
click on special
choose constants
press the delete key

Or with VBA

Range("E5:L18").SpecialCells(xlCellTypeConstants). ClearContents



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Jim" wrote in message .. .
I am using Excel 2002 and have a sheet which Ranges from E5:O78.
There are 20 ranges like E5:F18, H5:F18 etc which has only input info as in
a time sheet.
I need to delete the info with a macro but need to keep the Formulas outside
these Ranges
intact. I have been successfully using:
ActiveSheet.Unprotect
Range("E5:F18,H5:I18,K5:L18,etc................... .).ClearContents
ActiveSheet.Protect
but the formula length become unwieldy with 20 Ranges to clear, is there one
Formula which
will only delete non formula cells?
Many thanks
Jim




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Deleting Many Cells on a Sheet

Many thanks Ron, much easier!!


"Ron de Bruin" wrote in message
...
Select the range E5:L18 for example
Press F5
click on special
choose constants
press the delete key

Or with VBA

Range("E5:L18").SpecialCells(xlCellTypeConstants). ClearContents



--
Regards Ron de Bruin
(Win XP Pro SP-1 XL2002 SP-2)
www.rondebruin.nl



"Jim" wrote in message

.. .
I am using Excel 2002 and have a sheet which Ranges from E5:O78.
There are 20 ranges like E5:F18, H5:F18 etc which has only input info as

in
a time sheet.
I need to delete the info with a macro but need to keep the Formulas

outside
these Ranges
intact. I have been successfully using:
ActiveSheet.Unprotect
Range("E5:F18,H5:I18,K5:L18,etc................... .).ClearContents
ActiveSheet.Protect
but the formula length become unwieldy with 20 Ranges to clear, is there

one
Formula which
will only delete non formula cells?
Many thanks
Jim






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
Keep sheet from deleting contents Richard Excel Worksheet Functions 1 March 14th 08 03:24 AM
Clairification in finding and deleting cells from one sheet to ano Johnny B[_2_] Excel Discussion (Misc queries) 1 March 20th 07 12:44 AM
finding and deleting cells from one excel sheet to another Johnny B Excel Discussion (Misc queries) 5 March 19th 07 11:18 PM
Deleting every-other row in a spread sheet smintey Excel Discussion (Misc queries) 5 December 8th 04 05:08 PM
Deleting a Sheet Abdul Salam Excel Programming 1 July 29th 03 12:43 AM


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