graphing multiple data points from refreshed cells

  • Thread starter Thread starter Rick
  • Start date Start date
R

Rick

I have created a spreadsheet that imports current values
of certain data points from an external server (PI).
These current values run through a series of calculations
to determine a single output in a cell. By hitting the
F9 button, I can refresh the current values and
subsequently refresh the output data point (cell). I'd
like to capture the value of the output cell each time I
refresh it and graph the output data point versus time.
Does anyone know how to do this?
 
How about putting a button from the forms toolbar on the worksheet.

I created a new worksheet (sheet2) and put "Time/Date" in A1 and "Value" in B1
(headers). And I assumed the cell getting updated was B1 on the same sheet with
the button.

Then I assigned that button this macro:

Option Explicit
Sub testme()

Dim myCell As Range
Dim destCell As Range

Set myCell = ActiveSheet.Range("b1")

With Worksheets("sheet2")
Set destCell = .Cells(.Rows.Count, "B").End(xlUp).Offset(1, 0)
End With

With destCell
.Value = myCell.Value
With .Offset(0, -1)
.Value = Now
.NumberFormat = "mm/dd/yyyy hh:mm:ss"
End With
End With

Beep

Application.Calculate

End Sub
 
Back
Top