newly created Name Range not showing in name box
Posted on 2002-03-28
I am creating a range using VBA to be used as the datasource for a chart.
the code for the range is:
Dim wkstname As String
wkstname = ActiveSheet.Name
ActiveWorkbook.Names.Add Name:="SqFtData", RefersToR1C1:= _
"=OFFSET(" & wkstname & "!R3C11, COUNTA(" & wkstname & "!C11)-2,1)"
If I look under the Menu Insert, Names, Define. I can see it listed but if I select the listing, nothing happens.
Also, when I click on the names box, it is not shown.
this is being used as a recordsource for a chart. I took it off a website which gives this code to use for a chart when the data will change.
When I create the chart, I get an application error on this line:
ActiveChart.SetSourceData Source:=Sheets(shtname).Range( _
shtname contains the active sheetname and holds the correct value.
I hope this will be my last question on this project!