Setting the BackColor of a cell in code

  • Thread starter Thread starter DoctorV
  • Start date Start date
D

DoctorV

I have code on a button that changes a data entry cell to locked but
cannot seem to change its BackColor Below is the code for locking it.
What do Ineed to do to change the BackColor to Gray

Sheets("Level 2 Support Team Member").Range("b10").Locked = True

When I tried to do
Sheets("Level 2 Support Team Member").Range("b10").backcolor=gray o
the number for the color gray it won't work

Thank
 
..backcolor is not a property of the range object.

Try:

Sheets("Level 2 Support Team Member").Range( _
"B10").Interior.ColorIndex = 15
 
Thanks a lot JE I did not know that it was Interior.Color I always us
Access and thnk in terms of BackColo
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Command Button Blink Color 0
User-Defined Data TYPE 3
Changing Form BackColor in VB 1
BackColor in SubReport 5
Setting Cell BackColors From VBA 5
Help VBA code 6
TextBox & Backcolor 2
Field Backcolor Changes 3

Back
Top