• 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.

change font color

Afarag

Member
Dears,
i ask if i have a cells with a black color the content cell will be with a white color
using VBA code at all the worksheet

thanks :)
 
Hi, Afarag!
Have you tried using the built-in macro recorder that comes with Excel? Even if it don't optimize the code it's a very useful tool for getting quick and complete running code, which then you might tweak as required.
And about your question, neither VBA nor Excel change automatically the default font color to enhance readability as per the background fill, nor the inverse; you should do it manually.
Regards!
 
Hi ,

Something like this ?

Activecell.Interior.Color = Activecell.Interior.Color XOR &HFFFFFF
Activecell.Font.Color = Activecell.Font.Color XOR &HFFFFFF

If you want the entire worksheet to change , use the following :

Cells.Interior.Color = Cells.Interior.Color XOR &HFFFFFF
Cells.Font.Color = Activecell.Font.Color XOR &HFFFFFF

Narayan
 
Back
Top