PC Review


Reply
Thread Tools Rate Thread

Colors programatically

 
 
Steven
Guest
Posts: n/a
 
      7th Sep 2008
What code do I use on a command button that will let the user choose a color
for interior and font.

Thanks you,

Steven
 
Reply With Quote
 
 
 
 
JLGWhiz
Guest
Posts: n/a
 
      7th Sep 2008
With ActiveSheet.ActiveCell
.Interior.ColorIndex = 5
.Font.ColorIndex = 1
End With

"Steven" wrote:

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

 
Reply With Quote
 
Steven
Guest
Posts: n/a
 
      7th Sep 2008
Thank you for the response. What I am looking for is to open up the palate
so they can choose their own color.


"JLGWhiz" wrote:

> With ActiveSheet.ActiveCell
> .Interior.ColorIndex = 5
> .Font.ColorIndex = 1
> End With
>
> "Steven" wrote:
>
> > What code do I use on a command button that will let the user choose a color
> > for interior and font.
> >
> > Thanks you,
> >
> > Steven

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      7th Sep 2008
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.

"JLGWhiz" wrote:

> With ActiveSheet.ActiveCell
> .Interior.ColorIndex = 5
> .Font.ColorIndex = 1
> End With
>
> "Steven" wrote:
>
> > What code do I use on a command button that will let the user choose a color
> > for interior and font.
> >
> > Thanks you,
> >
> > Steven

 
Reply With Quote
 
Dave Peterson
Guest
Posts: n/a
 
      7th Sep 2008
For the font color:
Application.Dialogs(xlDialogFormatFont).Show
or
Application.Dialogs(xlDialogFontProperties).Show


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



Steven wrote:
>
> What code do I use on a command button that will let the user choose a color
> for interior and font.
>
> Thanks you,
>
> Steven


--

Dave Peterson
 
Reply With Quote
 
Steven
Guest
Posts: n/a
 
      7th Sep 2008

Very nice. Thank you.

"Dave Peterson" wrote:

> For the font color:
> Application.Dialogs(xlDialogFormatFont).Show
> or
> Application.Dialogs(xlDialogFontProperties).Show
>
>
> For the pattern/fill:
> Application.Dialogs(xlDialogPatterns).Show
>
>
>
> Steven wrote:
> >
> > What code do I use on a command button that will let the user choose a color
> > for interior and font.
> >
> > Thanks you,
> >
> > Steven

>
> --
>
> Dave Peterson
>

 
Reply With Quote
 
JLGWhiz
Guest
Posts: n/a
 
      7th Sep 2008
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.

"Steven" wrote:

> Thank you for the response. What I am looking for is to open up the palate
> so they can choose their own color.
>
>
> "JLGWhiz" wrote:
>
> > With ActiveSheet.ActiveCell
> > .Interior.ColorIndex = 5
> > .Font.ColorIndex = 1
> > End With
> >
> > "Steven" wrote:
> >
> > > What code do I use on a command button that will let the user choose a color
> > > for interior and font.
> > >
> > > Thanks you,
> > >
> > > Steven

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Color laser printer prints colors much darker than screen colors John McGaw Computer Hardware 0 27th Jan 2009 01:24 AM
Re: Color laser printer prints colors much darker than screen colors John McGaw Computer Hardware 0 24th Jan 2009 10:24 PM
Lost highlighting and font colors; background colors on web pages =?Utf-8?B?SmFuIGluIFJhbGVpZ2g=?= Microsoft Excel Misc 2 31st Jul 2007 09:10 PM
Windows Mail Stationery Stopped Working, Also Font colors and background colors... John Hanley Windows Vista Mail 4 5th Jun 2007 01:18 PM
How to change the system colors programatically Schuntermann Joerg \(IFAT IT MFG COC MES MAC\) Microsoft C# .NET 1 31st Jul 2003 01:22 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:25 PM.