Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Change the line color based on the value selected in combo box

Hi,
I am using the VBA. I want to change the line color based on the value
selected in the combo box. Can anybody help on this.

Thanks,
Avinash Sharma
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 167
Default Change the line color based on the value selected in combo box

Private Sub ComboBox1_Change()
Shapes(yourlinename).Line.ForeColor.SchemeColor = ComboBox1.Value
End Sub

Replace yourlinename with the name of the line you want to change.
Likewise, if your combobox is not Combobox1 you must change this reference as
well. The combobox should contain the SchemeColor numbers that correspond to
the color you want. For instance,

Color SchemeColor Number
White 1
Red 2
Light Green3
Blue 4
Yellow 5
Pink 6
Cyan 7
Black 8
Green 17
Light Gray 22
Gray 23
Orange 53


You could also list the names of the colors in the combobox and reference
the color number in code based on the selection.



"Avinash" wrote:

Hi,
I am using the VBA. I want to change the line color based on the value
selected in the combo box. Can anybody help on this.

Thanks,
Avinash Sharma

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 change line chart color based on condition like + and -. egii Charts and Charting in Excel 1 May 8th 09 09:06 AM
How to change color of line and point markers on a line graph SASPerson Charts and Charting in Excel 1 November 15th 06 06:43 PM
Change Line color based on 2 different cells lawdoggy Excel Discussion (Misc queries) 4 October 23rd 06 10:14 PM
Make a line in a bar chart, and change color of any bars that exceed the line MarkM Excel Discussion (Misc queries) 4 July 5th 06 04:06 PM
How to change a bar to line in a combo chart? KimD Charts and Charting in Excel 2 August 10th 05 06:23 PM


All times are GMT +1. The time now is 03:33 AM.

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

About Us

"It's about Microsoft Excel"