Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello,
What is the code to clear the content of an entire column, except for the cells that have formulas? Thank you! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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).ClearContent s On Error GoTo 0 End Sub '<<============= --- Regards, Norman "Filo" wrote in message ... Hello, What is the code to clear the content of an entire column, except for the cells that have formulas? Thank you! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]() 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. -- rm24746 |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. F5SpecialConstants Gord Dibben MS Excel MVP On Mon, 30 Apr 2007 17:16:59 -0500, rm24746 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 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Clear Cells Content | Excel Discussion (Misc queries) | |||
Clear an XML Map of all content | Excel Programming | |||
clear column content | Excel Programming | |||
Clear Columns Content | Excel Programming | |||
Clear the content of a worksheet using VBA | Excel Programming |