News, tips, advice, support for Windows, Office, PCs & more. Tech help. No bull. We're community supported by donations from our Plus Members, and proud of it
Home icon Home icon Home icon Email icon RSS icon
  • VBA, Color Index isn't matching.

    Posted on krweaver Comment on the AskWoody Lounge

    This topic contains 2 replies, has 2 voices, and was last updated by  krweaver 5 months, 3 weeks ago.

    • Author
      Posts
    • #1122036 Reply

      krweaver
      AskWoody Lounger

      I am using the following:

      Code:
      CI = Sheets("Input").Range("G" & i).Interior.ColorIndex
      Sheets("Reformatted").Range("I" & i).Interior.ColorIndex = CI

      But, the attachment will show both the Input!Gi cell and the Reformatted!Ii cell.

      Why don’t they match?

      Clip0001

      Attachments:
    • #1125228 Reply

      debaser
      AskWoody_MVP

      When you use Colorindex, there are only 56 available values, versus the 16 million odd possible actual colours, so reading it gets the closest match on the colour palette to the actual cell colour. Use Color instead and they should match.

    • #1134415 Reply

      krweaver
      AskWoody Lounger

      Perfect!  Thank you!

    Please follow the -Lounge Rules- no personal attacks, no swearing, and politics/religion are relegated to the Rants forum.

    Reply To: VBA, Color Index isn't matching.

    You can use BBCodes to format your content.
    Your account can't use Advanced BBCodes, they will be stripped before saving.