Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,565
Default 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
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
values v formulas with conditional formats Riaan Excel Discussion (Misc queries) 9 May 28th 17 08:51 AM
Copy column, paste special formulas & number formats doesn't work Beckey Excel Discussion (Misc queries) 3 July 30th 09 07:51 PM
Pasting formats and values without formulas Rae Excel Worksheet Functions 3 June 20th 09 04:48 PM
Using VB Copy Entire Row but formulas and formats only no values Kenny Excel Discussion (Misc queries) 5 July 27th 08 11:12 PM
delete the test values, but do not delete the formulas kathy Excel Discussion (Misc queries) 1 February 21st 07 07:03 PM


All times are GMT +1. The time now is 08:18 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"