Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.charting
|
|||
|
|||
![]() Hi all I want to improve my VB colorbar sub programing to color bar chart below. This sub has the problem of range pre-defined at A2:A9. For Each Rng In Range("A2:A9") !! How can I modify it so it can scan any range? Because my workbook change often but the column name not change. Thanks Daniel ------------------------------------------------------- Sub colorbarr() Application.ScreenUpdating = False Dim Rng As Range Dim Cnt As Integer Cnt = 1 For Each Rng In Range("A2:A9") Set Pts = ActiveChart.SeriesCollection(1).Points(Cnt) If Rng.Value = "im" Then Pts.Interior.ColorIndex = 24 ElseIf Rng.Value = "surg" Then Pts.Interior.ColorIndex = 45 ElseIf Rng.Value = "ms" Then Pts.Interior.ColorIndex = 19 ElseIf Rng.Value = "other" Then Pts.Interior.ColorIndex = 35 End If Cnt = Cnt + 1 Next Rng End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Name defined Range - Copy? | Excel Discussion (Misc queries) | |||
How can I see defined name range? | Excel Discussion (Misc queries) | |||
Referencing defined range | Excel Discussion (Misc queries) | |||
Defined range using more than one column | Excel Discussion (Misc queries) | |||
Defined range problem | Excel Discussion (Misc queries) |