Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to delete column values and formats NOT formulas
This is what I have:
Sub ClearColumns() dtTemp = Range("C1") lngLastCol = Cells(1, Columns.Count).End(xlToLeft).Column For lngcol = 4 To lngLastCol If CDate(Cells(1, lngcol)) dtTemp Then _ Columns(lngcol).ClearContents Next End Sub How do I make this so it only deletes cell values and formatting? -- Hugo |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
VBA to delete column values and formats NOT formulas
It seems to me that if you leave the formulas, then they will calculate a
value based on their precedents/dependents and the cells will still reflect a value. If you turn off calculation, you would still have to make the cell values equal to and empty string to appear empty. I think you are in a catch 22. "Hugo" wrote in message ... This is what I have: Sub ClearColumns() dtTemp = Range("C1") lngLastCol = Cells(1, Columns.Count).End(xlToLeft).Column For lngcol = 4 To lngLastCol If CDate(Cells(1, lngcol)) dtTemp Then _ Columns(lngcol).ClearContents Next End Sub How do I make this so it only deletes cell values and formatting? -- Hugo |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
values v formulas with conditional formats | Excel Discussion (Misc queries) | |||
Copy column, paste special formulas & number formats doesn't work | Excel Discussion (Misc queries) | |||
Pasting formats and values without formulas | Excel Worksheet Functions | |||
Using VB Copy Entire Row but formulas and formats only no values | Excel Discussion (Misc queries) | |||
delete the test values, but do not delete the formulas | Excel Discussion (Misc queries) |