View Single Post
  #11   Report Post  
Posted to microsoft.public.excel.programming
Bill Renaud Bill Renaud is offline
external usenet poster
 
Posts: 417
Default Compare two worksheets and Highlight duplicates in each

Lisab wrote:
<<I tried using vbYellow, but that is what caused my error on my first
couple of attempts. That is why I changed "vbYellow" to "6"

I think you were using the ColorIndex or Pattern property originally,
which requires a Variant data type for the argument. If the value is a
number, then I imagine that the value can only go up to 56 or so,
according to the color table in the Remarks section at the bottom of the
ColorIndex Property topic in Help.

According to the Object Browser, vbYellow has the value of 65,535 and is
therefore too large for the ColorIndex property. This is what produces
the "Run-time error '1004': Unable to set the ColorIndex property of the
Interior class". Setting the value of ColorIndex specifies an "index"
into the default color palette. If a user changes the colors on the
default color palette (Colors tab in the Tools|Options dialog box), then
this color will be some other color.

vbYellow worked in my routine since I used the Color property.
--
Regards,
Bill Renaud