• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

conditional formatting problem

I have a file that has a lot of conditional formatting based on dates like a gantt chart. when status gets updated the logic has to be redone and i have to re-organize my tasks to match the new logic, however, all the indicators are visually seen on the gantt. I need those exact indications to transfer over to the new organization. I used VBA to go to the original gantt, pull all the data and paste it. however, everytime i paste that task that i have to search for and put it in a new sequence, the conditional formatting get duplicated. i have 800 tasks and now have 9600 conditional formats instead of my original 12 because i have to copy. how can i copy all formats and values but not the conditional formats in VBA?
 
Write some code to delete all existing conditions first

[pre]
Code:
For Each cell In Selection

For i = .FormatConditions.Count To 1

.FormatConditions(i).Delete
Next i
Next cell
[/pre]
 
I think you need a With statement in there, xld.

[pre]
Code:
For Each Cell In Selection
With Cell
For i = .FormatConditions.Count To 1

.FormatConditions(i).Delete
Next i
End With
Next Cell
[/pre]
 
is there a way i can just delete all on the temp sheet conditional formats and then copy the formats from the master sheet to remove all the redundants? i looked in to


Range("$A$4:$PK$800").FormatConditions.copy


but it doesn't exist. i need my conditional "applies to" field to have the ranges and not just to the corresponding row.
 
What are temp sheet conditional formats? They are either formats or not.


If you delet them all as I said, you can Copy>PasteSpecial Paste:=xlPasteFormats
 
Back
Top