PC Review


Reply
Thread Tools Rate Thread

Clear Content except for Formulas

 
 
=?Utf-8?B?Rmlsbw==?=
Guest
Posts: n/a
 
      28th Apr 2007
Hello,
What is the code to clear the content of an entire column, except for the
cells that have formulas?

Thank you!
 
Reply With Quote
 
 
 
 
Norman Jones
Guest
Posts: n/a
 
      28th Apr 2007
Hi Flo,

Try something like:

'=============>>
Public Sub Tester()
Dim Rng As Range

Set rng = Columns("A:A") '<<==== CHANGE

On Error Resume Next
Rng.SpecialCells(xlCellTypeConstants).ClearContents
On Error GoTo 0

End Sub
'<<=============


---
Regards,
Norman


"Filo" <(E-Mail Removed)> wrote in message
news:9509086E-3B3E-40F5-A895-(E-Mail Removed)...
> Hello,
> What is the code to clear the content of an entire column, except for the
> cells that have formulas?
>
> Thank you!



 
Reply With Quote
 
Gord Dibben
Guest
Posts: n/a
 
      1st May 2007
Which clears all the cells in column G.

What happened to the cells with formulas being left behind?

Maybe not so easy<g>

Next time you are recording go through the steps of selecting just those cells
without formulas before clearing contents.

F5>Special>Constants


Gord Dibben MS Excel MVP


On Mon, 30 Apr 2007 17:16:59 -0500, rm24746
<(E-Mail Removed)> wrote:

>
>>Filo;7553480 Wrote:
>> Hello,
>> >What is the code to clear the content of an entire column, except for

>> the
>> >cells that have formulas?

>>
>> >Thank you!

>
>Most of the questions such as yours can easily be answered by recording
>a macro TOOLS|MACRO|RECORD NEW MACRO. When I did this on a new
>worksheet and selecting the "G" column I got:
>
>Columns("G:G").Select
>Selection.ClearContents
>
>Wayne A.


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to transpose formulas from column content to row content. =?Utf-8?B?Tm90cm9t?= Microsoft Excel Worksheet Functions 1 12th Oct 2006 06:57 PM
how to clear clipboard content =?Utf-8?B?aXRjb20=?= Windows XP General 3 14th Sep 2006 01:07 AM
Clear an XML Map of all content DangerMouse Microsoft Excel Programming 1 23rd Jun 2006 02:43 PM
clear column content owl527 Microsoft Excel Programming 2 29th May 2006 01:17 PM
Clear the content of a cell Yee Microsoft Excel Misc 4 4th Mar 2004 10:35 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 01:29 PM.