VBA Color.Index=

P

Paul Moles

Can Color.Index= refer to a cell value eg (A1) or does it
have to be "hard coded" with a value?
 
B

Bernie Deitrick

Paul,

No need for hard coding:

Range("A2").Interior.ColorIndex = Range("A1").Value

HTH,
Bernie
Excel MVP
 
T

Thomas

[a1].Interior.ColorIndex = [a1].Value
This will work when A1 holds a valid colorindex number,if not it will
generate an error.
 

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

Top