View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default macro to ensure conditional formatting

You can apply the formatting with code, so after your macro deletes the
entries, have it reapply the formatting.

You can get the basic code by recording a macro while applying the
conditional formatting manually.

Just be aware that when applying the formatting, relative references like C5
are relative to the activecell.

--
Regards.
Tom Ogilvy



"Lava" wrote in message
...

I've got a column where the entries are checked against all fields of a
column on another worksheet. If there's no match the entry is invalid
and colored red. This is accomplished by means of Conditional
Formatting:


Code:
--------------------
=EN(AANTAL.ALS(Referentie_Lijst;C5)=0;NIET(ISLEEG( C5)))
--------------------


I've also written a macro which does the checking, but for ALL entry
fields of that column; not just the one which was just entered. The
reason for this was that I did some testing with the sheet. At some
point I had so many test values that I simply selected them all and
pressed [del]. To my surprise the Conditional Formatting for the fields
of that particular column was deleted as well.

Is there a real problem as I got a macro which takes care of things at
the end by checking them all by means of a button? Well, the people who
will be using the sheet for entry wish for the immediate check per
entry.

Is there a way by means of a macro or so to ensure that the Conditional
Formatting is "re-applied" or something in case it gets deleted? Or
should I resort to an all-macro solution? An all-macro solution would
be possible to make, but I just want to know if the Conditional
Formatting for a column can be locked or reapplied somehow.


--
Lava
------------------------------------------------------------------------
Lava's Profile:

http://www.excelforum.com/member.php...o&userid=27793
View this thread: http://www.excelforum.com/showthread...hreadid=479410