Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Resize Dynamic Ranges

Or, you could just make them dynamic where the second one depended on the
first
rng1=offset($A$2,0,0,counta($a:$a),4)
rng2=offset($h$2,0,0,counta($a:$a),4)
notice I changed the range from A to H but still counted rows in A.
--
Don Guillett
SalesAid Software

"VJ" wrote in message
...
I have two ranges rng1 and rng2. These are two dynamic ranges. I need to

resize the rng1 according to rng2.

How can I set the size of rng1 to rng2 through VBA code?

Looking for help.

Thanks



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Resize Dynamic Ranges

Or

rng2 = offset(rng1,0,7)

to make rng 2 the same size, offset by 7 columns (A to H)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Don Guillett wrote:

Or, you could just make them dynamic where the second one depended on the
first
rng1=offset($A$2,0,0,counta($a:$a),4)
rng2=offset($h$2,0,0,counta($a:$a),4)
notice I changed the range from A to H but still counted rows in A.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Resize Dynamic Ranges

Jon,
I never thought of that one. Isn't it great that you can do the same thing
in so many different ways.

Don Guillett
SalesAid Software

"Jon Peltier" wrote in message
...
Or

rng2 = offset(rng1,0,7)

to make rng 2 the same size, offset by 7 columns (A to H)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Don Guillett wrote:

Or, you could just make them dynamic where the second one depended on

the
first
rng1=offset($A$2,0,0,counta($a:$a),4)
rng2=offset($h$2,0,0,counta($a:$a),4)
notice I changed the range from A to H but still counted rows in A.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Resize Dynamic Ranges

Don -

This is a good one for defining the data for a chart. Define your X
values, then Y1 is offset(X,0,1), Y2 is offset(X,0,2), etc. When I first
came up with it I was just glad to eliminate all the typing in the tiny
Define Names box, but I've since realized how it also improves the
uniformity of the data ranges.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Don Guillett wrote:

Jon,
I never thought of that one. Isn't it great that you can do the same thing
in so many different ways.

Don Guillett
SalesAid Software

"Jon Peltier" wrote in message
...

Or

rng2 = offset(rng1,0,7)

to make rng 2 the same size, offset by 7 columns (A to H)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Don Guillett wrote:


Or, you could just make them dynamic where the second one depended on


the

first
rng1=offset($A$2,0,0,counta($a:$a),4)
rng2=offset($h$2,0,0,counta($a:$a),4)
notice I changed the range from A to H but still counted rows in A.





  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,337
Default Resize Dynamic Ranges

Jon,

If you aren't aware of this idea maybe it will help for all the typing.
Just select one you have already donetype in a new nameselect the refers
to box<F2edit only what is necessary. This is how I usually do it so never
stumbled across your method.

--
Don Guillett
SalesAid Software

"Jon Peltier" wrote in message
...
Don -

This is a good one for defining the data for a chart. Define your X
values, then Y1 is offset(X,0,1), Y2 is offset(X,0,2), etc. When I first
came up with it I was just glad to eliminate all the typing in the tiny
Define Names box, but I've since realized how it also improves the
uniformity of the data ranges.

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Don Guillett wrote:

Jon,
I never thought of that one. Isn't it great that you can do the same

thing
in so many different ways.

Don Guillett
SalesAid Software

"Jon Peltier" wrote in message
...

Or

rng2 = offset(rng1,0,7)

to make rng 2 the same size, offset by 7 columns (A to H)

- Jon
-------
Jon Peltier, Microsoft Excel MVP
Peltier Technical Services
Tutorials and Custom Solutions
http://PeltierTech.com/
_______

Don Guillett wrote:


Or, you could just make them dynamic where the second one depended on


the

first
rng1=offset($A$2,0,0,counta($a:$a),4)
rng2=offset($h$2,0,0,counta($a:$a),4)
notice I changed the range from A to H but still counted rows in A.








  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 70
Default Resize Dynamic Ranges

Don -

Yep, I've done that too. Laziness is the mother of invention.

- Jon

Don Guillett wrote:

Jon,

If you aren't aware of this idea maybe it will help for all the typing.
Just select one you have already donetype in a new nameselect the refers
to box<F2edit only what is necessary. This is how I usually do it so never
stumbled across your method.


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 Ranges Graham Excel Worksheet Functions 5 August 29th 07 12:00 AM
Dynamic Ranges Graham Excel Discussion (Misc queries) 0 July 24th 07 01:24 PM
Dynamic Formulas with Dynamic Ranges Ralph Howarth Excel Worksheet Functions 5 January 21st 05 08:44 AM
Resize Dynamic Ranges Chip Pearson Excel Programming 0 July 29th 04 04:22 PM
Resize Dynamic Ranges Frank Kabel Excel Programming 0 July 29th 04 04:16 PM


All times are GMT +1. The time now is 05:15 AM.

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"