hepzibahr
10-19-2011, 10:14 AM
Private Sub Worksheet_Activate()
Dim maxvalue As Integer
Dim minvalue As Integer
minValue = Sheets("Table 1").Range("A12").Value
minValue = Sheets("Table 1").Range("A13").Value
Sheets("F1 Projekt").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.HasAxis(xlValue) = True
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = minValue
ActiveChart.Axes(xlValue).MaximumScale =maxValue
'ActiveChart.Axes(xlValue).MajorUnit = 300000
ActiveChart.Axes(xlValue).MinorUnit = 400000
ActiveChart.Refresh
End Sub
Iam getting error in the line where i get the minValue ,maxvalue .
A12 in Sheet Table 1 holds a fomula MIN(C5:D10) same goes for A13 which has max(c5:D10)
Dim maxvalue As Integer
Dim minvalue As Integer
minValue = Sheets("Table 1").Range("A12").Value
minValue = Sheets("Table 1").Range("A13").Value
Sheets("F1 Projekt").Select
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.HasAxis(xlValue) = True
ActiveSheet.ChartObjects("Chart 1").Activate
ActiveChart.Axes(xlValue).Select
ActiveChart.Axes(xlValue).MinimumScale = minValue
ActiveChart.Axes(xlValue).MaximumScale =maxValue
'ActiveChart.Axes(xlValue).MajorUnit = 300000
ActiveChart.Axes(xlValue).MinorUnit = 400000
ActiveChart.Refresh
End Sub
Iam getting error in the line where i get the minValue ,maxvalue .
A12 in Sheet Table 1 holds a fomula MIN(C5:D10) same goes for A13 which has max(c5:D10)