[ 初めての方へ | 一覧(最新更新順) | 全文検索 | 過去ログ ]
『VBAで折れ線グラフ』(あやめ)
VBAで折れ線グラフを表示しました。
各点をそれぞれ異なった(指定)色にしたいのですが
可能でしょうか?可能であればその方法をおしえてくだい。
excell2000
windows2000
手作業をマクロの記録で確認してみました(あきお)
Sub Macro2()
ActiveSheet.ChartObjects(1).Activate
For I = 1 To 5
Select Case Worksheets(1).Cells(I, 1).Value
Case "赤"
ActiveChart.SeriesCollection(1).Points(I).MarkerBackgroundColorIndex = 3
ActiveChart.SeriesCollection(1).Points(I).MarkerForegroundColorIndex = 3
Case "白"
ActiveChart.SeriesCollection(1).Points(I).MarkerBackgroundColorIndex = 2
ActiveChart.SeriesCollection(1).Points(I).MarkerForegroundColorIndex = 1
Case Else
ActiveChart.SeriesCollection(1).Points(I).MarkerBackgroundColorIndex = 1
ActiveChart.SeriesCollection(1).Points(I).MarkerForegroundColorIndex = 1
End Select
Next I
End Sub
ありがとうございます。
早速試します。
ところで、手作業の内容もお知らせください。
宜しくお願いします。
あやめ
マーカーの前景と背景の色を変更します(あきお) http://homepage3.nifty.com/pcsalon/eg/eg02.htm 変更したい点をダブルクリックで選択後、 3.線の色、タイトル色の変更 のところです
こういうことですか。
Sub Test()
ActiveSheet.ChartObjects(1).Activate
With ActiveChart.SeriesCollection(1)
.Points(1).MarkerBackgroundColorIndex = 5
.Points(1).MarkerForegroundColorIndex = 5
.Points(2).MarkerBackgroundColorIndex = 7
.Points(2).MarkerForegroundColorIndex = 7
.Points(3).MarkerBackgroundColorIndex = 9
.Points(3).MarkerForegroundColorIndex = 9
.Points(4).MarkerBackgroundColorIndex = 15
.Points(4).MarkerForegroundColorIndex = 15
.Points(5).MarkerBackgroundColorIndex = 20
.Points(5).MarkerForegroundColorIndex = 20
.Points(6).MarkerBackgroundColorIndex = 23
.Points(6).MarkerForegroundColorIndex = 23
End With
End Sub
(川野鮎太郎)
ごめんなさい。ダブルクリックは間違っていました m(__)m 点をクリックすると6つの点が選択された状態になると思いますので、その後、 最初にクリックした点とは別の点を、クリックしてください(あきお)
質問とはまったく関係ありませんが、、、 川野鮎太郎さんですね^^; 関連(?)ログ [[20040827114840]] [[20060724222928]] (ROUGE)
不覚にも、大声を出して笑ってしまいました。 ...とても爽快な気分になりました(あきお)
[ 一覧(最新更新順) ]
YukiWiki 1.6.7 Copyright (C) 2000,2001 by Hiroshi Yuki.
Modified by kazu.