View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.charting
Eggle Eggle is offline
external usenet poster
 
Posts: 6
Default HowTo add row to series data

1) insert row with ShiftDown
2) apply new data to the newly emptied cells
3) preserve original chart series range

1) after this code row 2 is empty cells
Excel.Worksheet chart = (Excel.Worksheet)book.Worksheets["Chart Data"];
Excel.Range rngToday = chart.get_Range("A2", "D2");
rngToday.Insert(Excel.XlInsertShiftDirection.xlShi ftDown);

2) this puts todays date into A2
rngToday.NumberFormat = "MM/dd";
rngToday.Value = DateTime.Today;

3) OOPS - the chart data is now A3..A7 because of the insert above

How do I reset the souce data to A2..A6
or
Perhaps I can preserve the original setting when I do the insert
---- insert but don't update cell references

???? What's the best way here