|
毎日表示させているものですが、、参考に
>Range(***)の***はSTRING変数で指定してもかまいません
Sub データー範囲指定()
Dim gyomin As Long, gyomax As Long
Dim GFMAX As Long, GFMIN As Long
With Worksheets("テスト")
gyomax = Range("$A$65536").End(xlUp).Row
gyomin = gyomax - 75
If Time < TimeValue("9:00") Then
GFMAX = (Int(.Range("F" & gyomin) / 100) * 100) + 200
GFMIN = (Int(.Range("F" & gyomin) / 100) * 100) - 200
Else
GFMAX = (Int(.Range("E16") / 100) * 100) + 100
GFMIN = (Int(.Range("E17") / 100) * 100) - 100
End If
With ActiveSheet.ChartObjects(1).Chart''''グラフの最大最小を変更
.Axes(xlValue).MaximumScale = GFMAX
.Axes(xlValue).MinimumScale = GFMIN
End With
ActiveSheet.ChartObjects(1).Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).Values = .Range("F" & gyomin & ":F" & gyomax)
ActiveChart.SeriesCollection(2).Values = .Range("AU" & gyomin & ":AU" & gyomax)
ActiveChart.SeriesCollection(3).Values = .Range("AV" & gyomin & ":AV" & gyomax)
ActiveChart.SeriesCollection(4).Values = .Range("Q" & gyomin & ":Q" & gyomax)
ActiveChart.SeriesCollection(5).Values = .Range("R" & gyomin & ":R" & gyomax)
ActiveChart.SeriesCollection(6).Values = .Range("BF" & gyomin & ":BF" & gyomax)
End with
End Sub
|
|