Colors programatically

  • Thread starter Thread starter Steven
  • Start date Start date
S

Steven

What code do I use on a command button that will let the user choose a color
for interior and font.

Thanks you,

Steven
 
Thank you for the response. What I am looking for is to open up the palate
so they can choose their own color.
 
You wanted code to choose a color, not assign it. How many options do you
intend to offer out of the 56 available, or will they be able to just
randomly select? You could set up a ListBox with the color name and let the
user choose from that. The the code behind the ListBox could tell which cell
to apply the selected value to.
Using an Inputbox would require the options to be spelled out somewhere,
possibley in the InputBox narrative, for the user to know what to enter in
the input window.

Give me some idea of how you want to handle the option criteria and I can
give you some code for it.
 
For the font color:
Application.Dialogs(xlDialogFormatFont).Show
or
Application.Dialogs(xlDialogFontProperties).Show


For the pattern/fill:
Application.Dialogs(xlDialogPatterns).Show
 
Very nice. Thank you.

Dave Peterson said:
For the font color:
Application.Dialogs(xlDialogFormatFont).Show
or
Application.Dialogs(xlDialogFontProperties).Show


For the pattern/fill:
Application.Dialogs(xlDialogPatterns).Show
 
myColor = Application.Dialogs(xlDialogColorPalette)

will return the palette but it will not allow you to select the color and
store it in the variable. Seem sort of dumb to me, but I tried two or three
different approaches and it keeps saying it can't get the value.

Think it over and see what else you can do.
 
Back
Top