Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
VH VH is offline
external usenet poster
 
Posts: 13
Default Define a variable for dynamic chart

I have a excel file wich I have modified with a number of userforms, macros
and so on. One of the macros make a chart wich the user can page through
several columns. One by one. I want the user to be able to save the file
witout having to change the macro.

I know how to define the open workbook as a variable, but I am not sure how
to use a variable in this macro?

ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = "='Log_1.xls'!XValues"
ActiveChart.SeriesCollection(1).Values = "='Log_1.xls'!YValues"
ActiveChart.SeriesCollection(1).Name = "='Log_1.xls'!Name"

Can anyone help me?
  #2   Report Post  
Posted to microsoft.public.excel.programming
VH VH is offline
external usenet poster
 
Posts: 13
Default Define a variable for dynamic chart

Maybe I didn't explain well enough. I want to exchange the
"='Log_1.xls'!XValues" with something like "=Variable!XValues". This is to be
able to save the file with another name.

BTW:

VH skrev:

I have a excel file which I have modified with a number of userforms, macros
and so on. One of the macros make a chart which the user can page through
several columns. One by one. I want the user to be able to save the file
witout having to change the macro.

I know how to define the open workbook as a variable, but I am not sure how
to use a variable in this macro?

ActiveChart.SeriesCollection.NewSeries
ActiveChart.SeriesCollection(1).XValues = "='Log_1.xls'!XValues"
ActiveChart.SeriesCollection(1).Values = "='Log_1.xls'!YValues"
ActiveChart.SeriesCollection(1).Name = "='Log_1.xls'!Name"

Can anyone help me?

  #3   Report Post  
Posted to microsoft.public.excel.programming
Udo Udo is offline
external usenet poster
 
Posts: 48
Default Define a variable for dynamic chart

Hi,
try "=" & Variable & "!.XValues"

Udo

  #4   Report Post  
Posted to microsoft.public.excel.programming
VH VH is offline
external usenet poster
 
Posts: 13
Default Define a variable for dynamic chart

Thank you Udo! Works perfect!

Udo skrev:

Hi,
try "=" & Variable & "!.XValues"

Udo


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Define Variable Name using VBA GTReferee Excel Discussion (Misc queries) 2 January 21st 09 06:37 PM
Define Dynamic Name kal4000 Excel Discussion (Misc queries) 12 June 26th 08 04:36 PM
dynamic search in the Define Name window Miri Excel Discussion (Misc queries) 0 January 17th 07 07:58 AM
How to define variable kishore Excel Programming 3 May 13th 05 10:22 AM


All times are GMT +1. The time now is 09:55 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"