I have developed a formula in EXcel that specifies the plot range for a chart in which the number of rows can vary.
I want to use a MACRO in order to adjust the graph to use this named range. This is what I have
Sub chartfix()
'
' chartfix Macro
'
'
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:="Custrange", PlotBy:=xlRows
ActiveWindow.Visible = False
Windows("ALMV25.xls").Activate
Range("K32").Select
End Sub
I have defined the name custrange as follows:
custrange=OFFSET('Custom Portfolios'!$A$18,0,0,'Custom Portfolios'!$M$1+1,12)
the above macro does not work, as I do not know how to insert custrange as the source data. Please help!
I want to use a MACRO in order to adjust the graph to use this named range. This is what I have
Sub chartfix()
'
' chartfix Macro
'
'
ActiveSheet.ChartObjects("Chart 5").Activate
ActiveChart.ChartArea.Select
ActiveChart.SetSourceData Source:="Custrange", PlotBy:=xlRows
ActiveWindow.Visible = False
Windows("ALMV25.xls").Activate
Range("K32").Select
End Sub
I have defined the name custrange as follows:
custrange=OFFSET('Custom Portfolios'!$A$18,0,0,'Custom Portfolios'!$M$1+1,12)
the above macro does not work, as I do not know how to insert custrange as the source data. Please help!