Update data and Y error bars in a chart
I'm using the following methodology for updating a number of charts in a
workbook. The methodology works but I'm wondering if there is a better way to update the data in a number of charts in a workbook as well as update the Y error bars for a number of data series in a chart? For i = 1 To 10 GA(i, 4) = "U5:U" & LRA(i, 3) & ",AD5:AD" & LRA(i, 3) & ",AF5:AF" & LRA(i, 3) & "" GA(i, 5) = "AE6:AE" & LRA(i, 3) & "" GA(i, 6) = "AG6:AG" & LRA(i, 3) & "" Sheets(GA(i, 3)).Select ActiveChart.PlotArea.Select ActiveChart.SetSourceData Source:=Sheets(GA(i, 2)).Range(GA(i, 4)), _ PlotBy:=xlColumns ActiveChart.SeriesCollection(1).Select ActiveChart.SeriesCollection(1).ErrorBar Direction:=xlY, Include:=xlBoth, _ Type:=xlCustom, Amount:=Sheets(GA(i, 2)).Range(GA(i, 5)), _ MinusValues:=Sheets(GA(i, 2)).Range(GA(i, 5)) ActiveChart.SeriesCollection(2).Select ActiveChart.SeriesCollection(2).ErrorBar Direction:=xlY, Include:=xlBoth, _ Type:=xlCustom, Amount:=Sheets(GA(i, 2)).Range(GA(i, 6)), _ MinusValues:=Sheets(GA(i, 2)).Range(GA(i, 6)) Next i Thanks in advance, Raul |
All times are GMT +1. The time now is 02:35 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com