Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,814
Default color selector

Good day,

Is there any VBA code that will pop up the Excel cell shading pallete and
allow the user to select the color. Then, I want to store the number of the
color that they have selected for later use. Kind of like the
"GetOpenFileName" method, but open the cell shading colors instead.

Thanks,
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default color selector

Function ReturnColorindex(Optional Text As Boolean = False) As Long
Dim rngCurr As Range
Set rngCurr = Selection
Application.ScreenUpdating = False
Range("IV1").Select
Application.Dialogs(xlDialogPatterns).Show
ReturnColorindex = ActiveCell.Interior.ColorIndex
If ReturnColorindex = xlColorIndexAutomatic And Not Text Then
ReturnColorindex = xlColorIndexNone
End If
ActiveCell.Interior.ColorIndex = xlColorIndexAutomatic
rngCurr.Select
Set rngCurr = ActiveSheet.UsedRange
End Function


--
HTH

Bob Phillips

"Steve" wrote in message
...
Good day,

Is there any VBA code that will pop up the Excel cell shading pallete and
allow the user to select the color. Then, I want to store the number of

the
color that they have selected for later use. Kind of like the
"GetOpenFileName" method, but open the cell shading colors instead.

Thanks,



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default color selector

No, not really.

If you pop it up, then when they select a color it will be provided to the
active cell.

If that is fine, then you can query the activecell for the colorindex
select.

Sub ABCD()
Application.Dialogs(xlDialogPatterns).Show
Msgbox ActiveCell.Interior.ColorIndex
End Sub

--
Regards,
Tom Ogilvy


"Steve" wrote in message
...
Good day,

Is there any VBA code that will pop up the Excel cell shading pallete and
allow the user to select the color. Then, I want to store the number of

the
color that they have selected for later use. Kind of like the
"GetOpenFileName" method, but open the cell shading colors instead.

Thanks,



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
how to drag down Fill Color selector in Excel 2007? mj Excel Discussion (Misc queries) 2 October 8th 09 08:53 PM
Selector disappears Norma Bliven[_2_] Excel Discussion (Misc queries) 1 October 29th 08 05:12 PM
Equation Selector zephyr Excel Discussion (Misc queries) 7 February 17th 06 06:41 PM
selector kwcarson Excel Worksheet Functions 0 February 13th 05 12:19 AM
selector kwc Excel Worksheet Functions 0 February 13th 05 12:17 AM


All times are GMT +1. The time now is 05:44 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"