VBA Color.Index=

  • Thread starter Thread starter Paul Moles
  • Start date Start date
P

Paul Moles

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

No need for hard coding:

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

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