Share via

display color picker using VBA code

Anonymous
2017-03-17T16:14:54+00:00

I want to change all the cells in my spreadsheet that are a particular background color, to a different color.  I have designed a pretty easy way to do that, but I currently have to hard code the values of both the original and new colors.  It would be nice if I could display the "color picker" dialog (twice) so I could select each of them from the palette.  Is there a way to do that from within VBA code?

I can get the original color if the background of the active cell is the color I want to change, but I can't figure out how to select the new color.  If it was the font color I wanted to change, I could do it using:

Application.Dialogs(xlDialogFontProperties).Show

but I can't find a similar method for dealing with the background color.

Any help would be much appreciated.

Thanks!

HJ

Microsoft 365 and Office | Excel | For home | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments

Answer accepted by question author

Anonymous
2017-03-17T16:29:17+00:00

Application.Dialogs(xlDialogPatterns).Show

Was this answer helpful?

2 people found this answer helpful.
0 comments No comments

1 additional answer

Sort by: Most helpful
  1. Anonymous
    2017-03-17T17:01:22+00:00

    Application.Dialogs(xlDialogFontProperties).Show

    Aha!  There's usually an answer, it's just not always obvious.....

    Thanks very much!

    HJ

    Was this answer helpful?

    1 person found this answer helpful.
    0 comments No comments