View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.misc
DaveM DaveM is offline
external usenet poster
 
Posts: 31
Default How To Anchor Chart Data

I am using this code to add/paste data from another sheet(1) in to column K
on sheet2 at 1 minute inertvals. This macro works fine and when it runs it
emulates a stream of data (1 min appart) which places the most current value
in colum K and the value streams to the right with the furthest right colund
being the oldest/first data value.

This acts as a ticker tape essentially while the data stream is placed in a
chart as a data series. The problem I have is I only want to plot the data
values from K1:X1 on sheet2 but i need the data stream to continue out to
column IV. Right now the chart's Y scale continues to adjust/expand as the
values grow to the right, past X1. How can I anchor the Chart's scale so it
does not expand when the insert function moves the columns to the right?

Sub UpDateSub()
Worksheets("Sheet2").Range("K1:K42").Select
Selection.Insert Shift:=xlToRight
Worksheets("Sheet1").Range("A40").Copy
Worksheets("Sheet2").Range("K1").PasteSpecial xlValues
'Schedule next update
mdNextTime = Now + TimeValue("00:01:00")
Application.OnTime mdNextTime, "UpdateSub"
End Sub

Thanks DaveM