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

Prevent the cells from being colored black.

taoa

New Member
Dear Sir, how to prevent the coloring of black cells but only white cells. Thank you
 

Attachments

  • TEST.xlsm
    14.5 KB · Views: 3
[QUOTE = "NARAYANK991, message: 256969, membre: 1512"]
Salut ,

Voir le fichier attaché.

Narayan
[/CITATION]
Pouvez vous expliquez s'il vous plait,Merci.
Je vous adore NARAYANK991, toujours aussi perspicace.
 
Hi ,

Only a check for the interior color of the selected cell has been introduced.
Code:
    Const BlackInterior = 4210752
    
    If ActiveCell.Interior.Color <> BlackInterior Then
The color value for a black cell (at least the shade of black which you have used) is 4210752.

I have defined a constant named BlackInterior , since it is easier to remember a name like this rather than a value like 4210752.

The code then checks for whether the interior color of the cell where the cursor is placed is this color or not ; only if it is not this color , the buttons Buton and Effacer will work , since this same check has been used in both the macros.

Narayan
 
Back
Top