Excel cell colouring

  • Hi Guys,

    Very simple,

    If someone enters in a cell(say a1) 1 then it will colour the cell yellow

    If they had entered 2 then blue.

    Is that possible to do in vb??

  • Paste this into the worksheet module that you're using.

    This also allows more options (say you want it green if they enter 3 in the future or something) because you can just add another case to the Select Case statement.

    If you want to change the colors, the best way I know of finding out the indices is record a macro of turning a cell a specific color and then go check the code to find out what number it was.

    Hope this helps!

Participate now!

Don’t have an account yet? Register yourself now and be a part of our community!