ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   using names (https://www.excelbanter.com/excel-programming/315861-using-names.html)

hke[_15_]

using names
 

Thanks for your answers, and I guess local function names are not s
cool then.

I tried

ActiveWorkbook.Names.Add Name:="myX", RefersToR1C1:= _
"=OFFSET(sheet1!R10C7,0,0,1,sheet2!R7C2)"

and for the Values

ActiveWorkbook.Names.Add Name:="myY", RefersToR1C1:= _
"=OFFSET(sheet1!R93C7,0,0,1,sheet2!R7C2)"

, with


Set Currentchart = ChtObj.Chart
Currentchart.ChartType = xlXYScatterLines
Currentchart.Location Whe=xlLocationAsObject
Name:=ActiveSheet.Name
Set srs = Currentchart.SeriesCollection.NewSeries

srs.XValues = myX
srs.Values = myY

btw is
srs.Values = myY
the right way to do this?

Running my macro creates a chart but the Values are gone!
With my first approach with myX and myYIDV defined manually
(insert-names-define) using the disputed FORSKYVNING it worked fine.

I`m lost

--
hk
-----------------------------------------------------------------------
hke's Profile: http://www.excelforum.com/member.php...nfo&userid=155
View this thread: http://www.excelforum.com/showthread.php?threadid=27411



All times are GMT +1. The time now is 12:03 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com