Change Rows/Columns in range???
Got it, thanks! :)
"Tom Ogilvy" wrote in message
...
use offset
--
Regards,
Tom Ogilvy
"43fan" wrote in message
...
Also, I need to change the columns for the data that I'm using. IOW,
for
the first set of data, I may be using A13:A14, second set of data then
is
D13:D14. Resizing I'm sure isn't the right way to change the column, but
I
don't know what is then.
Thanks!
Shawn
PS - Thanks, I think the resizing will work fine for the rows, just need
to
figure out the column part. :)
"Pete McCosh" wrote in message
...
Shawn,
try
set rng1 = rng1.resize(rng1.rows.count + i, 1)
Although this will probably have the effect of increasing
by one row on the first pass, two on the second and so on,
so maybe:
set rng1 = rng1.resize(rng1.rows.count + 1, 1)
would be better?
Cheers, Pete
-----Original Message-----
I'm running the Forecast() function, which uses ranges in
order to process.
I initialize two variables, rng1 and rng2 to type range,
then set them equal
to the starting range I want.
I'm running it in a nested loop, based on (a) - how many
data sets and (b)
how many points of data within each set. I need to
increase the range with
each data set, as well as change the column it's looking
at for each data
point.
Say I'm starting with this:
rng1 = "B13:B14"
rng2 = "A13:A14"
Running var1=application.Forecast(0,rng2,rng1) works
fine, but of course I
get the same value for all data points/all data sets. I
can't figure out
how to get the ranges to resize, using rng1.Resize
(rng1.rows + i,1)
gives me a type mismatch error.
Help???!!!
Thanks!
Shawn
.
|