ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Range().resize giving errors (https://www.excelbanter.com/excel-programming/348999-re-range-resize-giving-errors.html)

Harry Tuttle

Range().resize giving errors
 
Harry, You are an idiot. You didn't understand how Range.resize
resizes your range. You thougt that the arguements were relative
arguments to resize the range, whereas they are absoute arguments, so
where you were saying
rng2 = rng1.resize(0,1); you were getting your 'application defined
error'

What you really meant to say was
set rng2 = rng1.resize( 0 + rng1.rows.count, 1 + rng1.columns.count)


Harry Tuttle wrote:

Hello

Could someone please tell me why when I code somthing like:

rng2 = rng1.resize(4,4)



^^^^^^^^^^^^^^^^^
If you woudl have actually coded that you wouldn't have gotten an error,
but instead you codded
rng2 = rng1.resize(0,1), you dumbass

gives me an 'application defined object error', while

rng1.resize(4,4).select works fine?

Thanks!


Tom Ogilvy

Range().resize giving errors
 
What you really meant to say was

set rng2 = rng1.resize(, 1 + rng1.columns.count)

--
Regards,
Tom Ogilvy


"Harry Tuttle" wrote in message
...
Harry, You are an idiot. You didn't understand how Range.resize
resizes your range. You thougt that the arguements were relative
arguments to resize the range, whereas they are absoute arguments, so
where you were saying
rng2 = rng1.resize(0,1); you were getting your 'application defined
error'

What you really meant to say was
set rng2 = rng1.resize( 0 + rng1.rows.count, 1 + rng1.columns.count)


Harry Tuttle wrote:

Hello

Could someone please tell me why when I code somthing like:

rng2 = rng1.resize(4,4)



^^^^^^^^^^^^^^^^^
If you woudl have actually coded that you wouldn't have gotten an error,
but instead you codded
rng2 = rng1.resize(0,1), you dumbass

gives me an 'application defined object error', while

rng1.resize(4,4).select works fine?

Thanks!




Johny Looser

Range().resize giving errors
 
Tom Ogilvy wrote:
What you really meant to say was

set rng2 = rng1.resize(, 1 + rng1.columns.count)


Thank!


All times are GMT +1. The time now is 07:38 PM.

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