![]() |
Excel color palette on user form?
Hello all,
I am working on a model where the users can select from multiple data sets; there are twelve different types of inputs. There are several different data set providers (i.e. research organisation 1, research org 2), and they may provide from 1 to 12 of the inputs. The purpose of the model is to allow us to combine different inputs to see the effects on the output. On the main output sheet, the names of the data sets are displayed and I would like to color code the names of the inputs so that all inputs from each organisation are the same color. I think I have worked out a way to do this in the VBA procedure which I use to run the model using some useful suggestions and code on the Internet (i.e. www.cpearson.com ) However, I would also like to add a user form to the model which allows the addtion of data sets. I would like to enable users to choose a color code for the data set from the list (ideally visually). Does anyone have any suggestions about how this could be achieved? Thanks, Shane |
Excel color palette on user form?
Shane,
You can do it easily with the commondialog controls. They are packaged with vb but can be used in vba. You need to add them to your toolbox using the additional controls command, then look for Microsoft Common Dialog Control, or browse for comdlg32.ocx in sys 32. Once it's on the toolbox, draw it onto a form, then you can do something like this: Private Function GetColour() as long CommonDialog1.ShowColor GetColour = CommonDialog1.Color End Function Robin Hammond www.enhanceddatasystems.com "Shane Henderson" wrote in message . com... Hello all, I am working on a model where the users can select from multiple data sets; there are twelve different types of inputs. There are several different data set providers (i.e. research organisation 1, research org 2), and they may provide from 1 to 12 of the inputs. The purpose of the model is to allow us to combine different inputs to see the effects on the output. On the main output sheet, the names of the data sets are displayed and I would like to color code the names of the inputs so that all inputs from each organisation are the same color. I think I have worked out a way to do this in the VBA procedure which I use to run the model using some useful suggestions and code on the Internet (i.e. www.cpearson.com ) However, I would also like to add a user form to the model which allows the addtion of data sets. I would like to enable users to choose a color code for the data set from the list (ideally visually). Does anyone have any suggestions about how this could be achieved? Thanks, Shane |
Excel color palette on user form?
Thanks very much Robin,
I'll give this a try! SH Shane, You can do it easily with the commondialog controls. They are packaged with vb but can be used in vba. You need to add them to your toolbox using the additional controls command, then look for Microsoft Common Dialog Control, or browse for comdlg32.ocx in sys 32. Once it's on the toolbox, draw it onto a form, then you can do something like this: Private Function GetColour() as long CommonDialog1.ShowColor GetColour = CommonDialog1.Color End Function Robin Hammond www.enhanceddatasystems.com "Shane Henderson" wrote in message . com... Hello all, I am working on a model where the users can select from multiple data sets; there are twelve different types of inputs. There are several different data set providers (i.e. research organisation 1, research org 2), and they may provide from 1 to 12 of the inputs. The purpose of the model is to allow us to combine different inputs to see the effects on the output. On the main output sheet, the names of the data sets are displayed and I would like to color code the names of the inputs so that all inputs from each organisation are the same color. I think I have worked out a way to do this in the VBA procedure which I use to run the model using some useful suggestions and code on the Internet (i.e. www.cpearson.com ) However, I would also like to add a user form to the model which allows the addtion of data sets. I would like to enable users to choose a color code for the data set from the list (ideally visually). Does anyone have any suggestions about how this could be achieved? Thanks, Shane |
All times are GMT +1. The time now is 07:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com