M
Miguel
Hi,
I have recorded a macro, but I want to improve it. I want VBA to select my
data to the last row automatically instead of manually changing the last cell
number. This is the VBA code:
ActiveWindow.SmallScroll Down:=15
ActiveSheet.ChartObjects("Chart 19").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(1).Values = "=Dental!R16C2:R74C2"
ActiveChart.SeriesCollection(2).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(2).Values = "=Dental!R16C3:R74C3"
ActiveChart.SeriesCollection(3).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(3).Values = "=Dental!R16C8:R74C8"
ActiveChart.SeriesCollection(4).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(4).Values = "=Dental!R16C9:R74C9"
Windows("Dental RADAR Monthly Report 200810.xls").SmallScroll Down:=36
ActiveWindow.Visible = False
Thus, instead of changing the number 74 (last row) I want VBA to
automatically do it. Is that possible?
Thanks
Miguel
I have recorded a macro, but I want to improve it. I want VBA to select my
data to the last row automatically instead of manually changing the last cell
number. This is the VBA code:
ActiveWindow.SmallScroll Down:=15
ActiveSheet.ChartObjects("Chart 19").Activate
ActiveChart.PlotArea.Select
ActiveChart.SeriesCollection(1).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(1).Values = "=Dental!R16C2:R74C2"
ActiveChart.SeriesCollection(2).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(2).Values = "=Dental!R16C3:R74C3"
ActiveChart.SeriesCollection(3).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(3).Values = "=Dental!R16C8:R74C8"
ActiveChart.SeriesCollection(4).XValues = "=Dental!R16C1:R74C1"
ActiveChart.SeriesCollection(4).Values = "=Dental!R16C9:R74C9"
Windows("Dental RADAR Monthly Report 200810.xls").SmallScroll Down:=36
ActiveWindow.Visible = False
Thus, instead of changing the number 74 (last row) I want VBA to
automatically do it. Is that possible?
Thanks
Miguel