Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.
Sub Macro4()
'
' Macro4 Macro
'
'
Rows("2:2").Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A2").Select
ActiveCell.FormulaR1C1 = "=NOW()"
Range("B2").Select
ActiveCell.FormulaR1C1 = "500"
Range("C2").Select
ActiveCell.FormulaR1C1 = "250"
Range("D2").Select
ActiveCell.FormulaR1C1 = "50%"
Range("D3").Select
End Sub
ChartThatAddsDates.xlsm
Sub NewDateLine()
If Range("A3") < DateSerial(Year(Now), Month(Now), Day(Now)) Then
Range("A3:F3").Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
Range("A3") = DateSerial(Year(Now), Month(Now), Day(Now))
Range("D3").Formula = "=IF(AND(B3>0,C3>0),C3/B3,NA())"
Range("B3").Select
End If
End Sub
ChartThatAddsDates1.xlsm
Open in new window
However, that as you rightly point out does not add to the graph, are you expecting the new row to become a new series in the graph?Where does current graph range start? If the range starts at row 2, by inserting a row at row 2 you are just pushing the grah data range down one row. I assume row 1 is headers and is included in the data range.
Rob H