Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Is there a problem with:
Dim block(101) as Range I've also tried block(), block(101), and still get object variable error messages that point to the first time I try to assign the range block(i). In my worksheet I have blocks of data of some 50 lines where the data in the block is from a common date. I have operations I want to perform on each block of data as a block. My idea was to define each block of common date as a range, do my calculations on the block, then iterate to the next date code. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub aa1()
Dim block(101) As Range For i = 0 To 101 Set block(i) = Range("A1").Offset( _ Int(Rnd() * 100 + 1), Int(Rnd() * 100 + 1)) _ .Resize(Int(Rnd() * 100 + 1), Int(Rnd() * 100 + 1)) Next End Sub worked fine for me. Just as a demonstration. -- Regards, Tom Ogilvy "br549" wrote: Is there a problem with: Dim block(101) as Range I've also tried block(), block(101), and still get object variable error messages that point to the first time I try to assign the range block(i). In my worksheet I have blocks of data of some 50 lines where the data in the block is from a common date. I have operations I want to perform on each block of data as a block. My idea was to define each block of common date as a range, do my calculations on the block, then iterate to the next date code. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thank you. I was trying "block(i)=range....", instead of "set
block(i)=range(....." Sorry for the stupid question, but thanks for the good answer. "Tom Ogilvy" wrote: Sub aa1() Dim block(101) As Range For i = 0 To 101 Set block(i) = Range("A1").Offset( _ Int(Rnd() * 100 + 1), Int(Rnd() * 100 + 1)) _ .Resize(Int(Rnd() * 100 + 1), Int(Rnd() * 100 + 1)) Next End Sub worked fine for me. Just as a demonstration. -- Regards, Tom Ogilvy "br549" wrote: Is there a problem with: Dim block(101) as Range I've also tried block(), block(101), and still get object variable error messages that point to the first time I try to assign the range block(i). In my worksheet I have blocks of data of some 50 lines where the data in the block is from a common date. I have operations I want to perform on each block of data as a block. My idea was to define each block of common date as a range, do my calculations on the block, then iterate to the next date code. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Working with ranges in arrays... or an introduction to arrays | Excel Programming | |||
comparing ranges/arrays | Excel Worksheet Functions | |||
Ranges and Arrays | Excel Programming | |||
Help with Arrays & Ranges in VBA | Excel Programming |