Hi,
I have a plot macro, see code below which I would like to continuously update the plots when a change been made to reference cells(E45:G45 and N3:P3). Anyone out there who can help me with this
Sub Engine()
COG_t = Range("E45:G45")
Eng_s = Range("N3:P3")
'Declaring variables
Dim xmax, xmin, ymax, ymin
Dim x, y
'Calculats the engine's position
xmax = COG_t(1, 1) + Eng_s(1, 1)
xmin = COG_t(1, 1) - Eng_s(1, 1)
ymax = COG_t(1, 2) + Eng_s(1, 2)
ymin = COG_t(1, 2) - Eng_s(1, 2)
'Creates the corner points of the engine
x = Array(xmax, xmin)
y = Array(ymax, ymin)
Engine_C = Array(x, y)
Module2.EngineContourPlot x, y
End Sub
In module2...
Sub EngineContourPlot(x, y)
Charts.Add.Name = "XY_View"
With ActiveChart
.ChartType = xlXYScatterSmoothNoMarkers
.SeriesCollection.NewSeries
With .SeriesCollection(.SeriesCollection.Count)
.Values = x
.XValues = y
End With
End With
End Sub
Gratful for help
\Jonas