PDA

View Full Version : paste text into chart



asdzxc
04-28-2012, 06:16 AM
plse add code so as to paste 3 o 5 or both into the chart

Range("C8").Select ActiveCell.FormulaR1C1 = "=(R[-3]C2)*2-R[-6]C2" Range("C8").Select Selection.AutoFill Destination:=Range("C8:C12"), Type:=xlFillDefault Range("C8:C12").Select Range("D4").Select ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(R[-2]C[-2]:RC[-2]),3)" Range("D4").Select Selection.AutoFill Destination:=Range("D4:D12"), Type:=xlFillDefault Range("D4:D12").Select Range("E6").Select ActiveCell.FormulaR1C1 = "=ROUND(AVERAGE(R[-4]C[-3]:RC[-3]),5)" Range("E6").Select Selection.AutoFill Destination:=Range("E6:E12"), Type:=xlFillDefault Range("E6:E12").Select Range("F10").Select ActiveCell.FormulaR1C1 = "=IF(RC[-4]<RC[-2],3,0)" Range("F10").Select Selection.AutoFill Destination:=Range("F10:F12"), Type:=xlFillDefault Range("F10:F12").Select Range("G10").Select ActiveCell.FormulaR1C1 = "=IF(RC[-5]<RC[-2],5,0)" Range("G10").Select Selection.AutoFill Destination:=Range("G10:G12"), Type:=xlFillDefault Range("G10:G12").Select Range("A2:C12").Select ActiveSheet.Shapes.AddChart.Select ActiveChart.ChartType = xlLineMarkers ActiveChart.SetSourceData Source:=Range("Sheet1!$A$2:$C$12")