PDA

View Full Version : Color picker



Djblois
04-27-2007, 05:23 AM
I was wondering if it is at all possible to include a color picker in a VBA form?

vonpookie
04-27-2007, 07:00 AM
John Walkenbach has a sample here:
http://j-walk.com/ss/excel/tips/tip49.htm

Bob Phillips
04-27-2007, 07:23 AM
Could call this function




'-----------------------------*------------------------------*----------------
Function GetColorindex(Optional Text As Boolean = False) As Long
'-----------------------------*------------------------------*----------------
Dim rngCurr As Range

Set rngCurr = Selection
Application.ScreenUpdating = False
Range("IV1").Select
Application.Dialogs(xlDialogPatterns).Show
GetColorindex = ActiveCell.Interior.ColorIndex
If GetColorindex = xlColorIndexAutomatic And Not Text Then
GetColorindex = xlColorIndexNone
End If
ActiveCell.Interior.ColorIndex = xlColorIndexAutomatic
rngCurr.Select
Set rngCurr = ActiveSheet.UsedRange
Application.ScreenUpdating = True
End Function