using offset.resize to dimension an array? (vba)

NileshRam

New Member
Joined
Jul 9, 2015
Messages
4
Hi guys,

I have a code which uses offset.resize to get a full range of cells but each time i try to define that range as an array - I keep getting the error 'Object doesn't support this property or method'.

I made sure that the array has the correct dimensions, I was wondering if someone could point me in the right direction as to how I can use the offset resize properties together to define my array?
'######################################################################
dim prefrnt() as variant

redim prefrnt(1 to 21, 1 to 21)



For i = 1 To 700
If StrComp(ws8.Cells(i, 1), Left(frntfut, Len(frntfut) - 4), vbTextCompare) = 0 Then
For j = 1 To 100
If ws8.Cells(i + 1, j) = "Futures" Then
prefrnt = ws8.Cells(i + 1, j).Offset(1, 1).Resize(21, 21).Values <<<<< code gets stuck here

'######################################################################

Any help would be much appreciated!

Cheers,

Nilesh
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
I guess issue with be low line
Code:
[COLOR=#333333]ws8.Cells(i + 1, j).Offset(1, 1).Resize(21, 21).Values 

this should be 
[/COLOR][COLOR=#333333]ws8.Cells(i + 1, j).Offset(1, 1).Resize(21, 21).Value[/COLOR][COLOR=#333333]

[/COLOR]


 
Upvote 0

Forum statistics

Threads
1,215,290
Messages
6,124,091
Members
449,142
Latest member
championbowler

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top