Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 296
Default Showing the standard XL Colour chart

Hi,

From within a VBA Form I need to open up the standard Excel colour
chart so that the user can make a selection which will become a
variable I use elsehwere in the code.

Can someone point me in the right direction please.

Many thanks.


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Showing the standard XL Colour chart

Are you talking about showing this:

Application.Dialogs(xlDialogPatterns).Show

or This

Application.Dialogs(xlDialogColorPalette).Show

These are not generic color picker dialogs. The don't return the Selection.
Bob Phillips has posted code like this which actually colors a cell and then
gets the color of the cell:

'-----------------------------*------------------------------*
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


--
Regards,
Tom Oglvy


"Richard Buttrey" wrote in
message ...
Hi,

From within a VBA Form I need to open up the standard Excel colour
chart so that the user can make a selection which will become a
variable I use elsehwere in the code.

Can someone point me in the right direction please.

Many thanks.


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Showing the standard XL Colour chart


'-----------------------------*------------------------------*--------------
--
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



--

HTH

RP
(remove nothere from the email address if mailing direct)


"Richard Buttrey" wrote in
message ...
Hi,

From within a VBA Form I need to open up the standard Excel colour
chart so that the user can make a selection which will become a
variable I use elsehwere in the code.

Can someone point me in the right direction please.

Many thanks.


__
Richard Buttrey
Grappenhall, Cheshire, UK
__________________________



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Showing the standard XL Colour chart


This should get you started:

Application.Dialogs.Item(xlDialogColorPalette).Sho w

Hope this helps!


--
malik641


------------------------------------------------------------------------
malik641's Profile: http://www.excelforum.com/member.php...o&userid=24190
View this thread: http://www.excelforum.com/showthread...hreadid=480459

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
Standard Chart from PivotTable ? H.G. Lamy Charts and Charting in Excel 0 December 17th 09 10:38 AM
Why has Excel stopped showing colour changes to fonts & text? bdb Excel Discussion (Misc queries) 1 October 31st 07 02:21 AM
Excel - highlight colour of cell not showing except on preview Jacana Excel Discussion (Misc queries) 2 June 14th 06 07:36 PM
No showing of cellnumbers used in formular with colour /Maria Excel Worksheet Functions 5 June 3rd 05 12:52 PM
How do I set up a standard form showing incentive calculations KeithB Excel Discussion (Misc queries) 2 May 30th 05 09:41 AM


All times are GMT +1. The time now is 01:29 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"