Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default dynamic range reference and use of common code


I have 2 questions.

1. I need to graph a range that may change each time the code is run.
How do I reference it? The starting cell is always fixed to F2. But
the ending cell (bottom right cell of the range) is dynamic. It is
determined by how many members in a 2-dimensional array myarray(13,18).
The number of elements in the first dimension changes, but the the
number of elements in the 2nd dimension is always 18. shall I code
it?

2. I need to use the following piece of code in multiple places in my
program:
..fieldnames=true
..rownumbers=false
..refreshonfileopen=true

Basically I'm setting properties for an imported file. I need to
import multipe files, and I suppose I can use the same property
settings for each one of the imports. How do I code it so that I can
write that code once and use it repeatedly?

Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 90
Default dynamic range reference and use of common code

For the first, if you always have 18 series with a varying amount of
points, you could just make a dynamic chart, which has series based on
dynamic named ranges. Check out examples and links:
http://www.geocities.com/jonpeltier/.../Dynamics.html

If the number of series is varying, you can't do it quite so smoothly,
but you could define a dynamic named range (same instructions as above
setting up the range), then use it in a SetSourceData statement for the
chart.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
http://www.geocities.com/jonpeltier/Excel/index.html
_______

clui wrote:

I have 2 questions.

1. I need to graph a range that may change each time the code is run.
How do I reference it? The starting cell is always fixed to F2. But
the ending cell (bottom right cell of the range) is dynamic. It is
determined by how many members in a 2-dimensional array myarray(13,18).
The number of elements in the first dimension changes, but the the
number of elements in the 2nd dimension is always 18. shall I code
it?

2. I need to use the following piece of code in multiple places in my
program:
.fieldnames=true
.rownumbers=false
.refreshonfileopen=true

Basically I'm setting properties for an imported file. I need to
import multipe files, and I suppose I can use the same property
settings for each one of the imports. How do I code it so that I can
write that code once and use it repeatedly?

Thanks!


------------------------------------------------
~~ Message posted from http://www.ExcelTip.com/
~~View and post usenet messages directly from http://www.ExcelForum.com/

~~Now Available: Financial Statements.xls, a step by step guide to creating financial statements


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 493
Default dynamic range reference and use of common code

Take a look at Jon Peltier's site:

http://www.geocities.com/jonpeltier/...x.html#hdrDyno

In article ,
clui wrote:

1. I need to graph a range that may change each time the code is run.
How do I reference it? The starting cell is always fixed to F2. But
the ending cell (bottom right cell of the range) is dynamic. It is
determined by how many members in a 2-dimensional array myarray(13,18).
The number of elements in the first dimension changes, but the the
number of elements in the 2nd dimension is always 18. shall I code
it?

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
Dynamic range where the reference cell can change hello Excel Discussion (Misc queries) 2 May 19th 08 10:11 PM
macro code to get dynamic range ashish128 Excel Discussion (Misc queries) 3 June 15th 07 02:41 PM
Vlookup - dynamic range reference? aseanor Excel Discussion (Misc queries) 7 August 17th 06 11:32 PM
How to dynamically reference a dynamic named range paris3 Excel Worksheet Functions 4 June 24th 05 01:22 AM
Reference to a dynamic range Yossi Excel Discussion (Misc queries) 2 April 12th 05 12:57 PM


All times are GMT +1. The time now is 11:09 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"