Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Question about working with range array

Excel 2002
Windows XP Pro SP2

I have an array that is filled with range objects. The range extents are
rows of data, from A to M and from many different row numbers. How do I
access a particular cell value within a range object? For instance:

i = 0
For Each cell in myRange.Cells
If cell.Offset(0, 2).Value < cell.Offset(0,5 ).Value Then
i = i + 1
Set NewRng(i) = Range(cell, cell.Offset(0, 12))
End If
Next cell

'Now loop through NewRng and evaluate the cell value in the 4th column of
NewRng

For i = 1 to TotRngs
Msgbox NewRng(i).????.Address 'what should I put in place of ????
Next i

Any and all help appreciated.

-gk-


================================================== ======================
"The creative act is not the province of remote oracles or rarefied
geniuses but a transparent process that is open to everyone."
-Greg Kot in Wilco Learning How To Die-


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Question about working with range array


Hello GK,

To get the 4th column's address for each NewRng, do this...

For i = 1 to TotRngs
Msgbox NewRng(i).Cells(1, 4).Address
Next i

Sincerely,
Leith Ross


--
Leith Ross
------------------------------------------------------------------------
Leith Ross's Profile: http://www.excelforum.com/member.php...o&userid=18465
View this thread: http://www.excelforum.com/showthread...hreadid=502703

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,452
Default Question about working with range array

Something like this, so use Cells:

Sub test()

Dim i As Byte
Dim arr(1 To 10) As Range

For i = 1 To 10
Set arr(i) = Range(Cells(i, 1), Cells(i, 5))
Next

For i = 1 To 5
MsgBox arr(i).Cells(i)
Next

End Sub


RBS

"39N 95W" wrote in message
...
Excel 2002
Windows XP Pro SP2

I have an array that is filled with range objects. The range extents are
rows of data, from A to M and from many different row numbers. How do I
access a particular cell value within a range object? For instance:

i = 0
For Each cell in myRange.Cells
If cell.Offset(0, 2).Value < cell.Offset(0,5 ).Value Then
i = i + 1
Set NewRng(i) = Range(cell, cell.Offset(0, 12))
End If
Next cell

'Now loop through NewRng and evaluate the cell value in the 4th column of
NewRng

For i = 1 to TotRngs
Msgbox NewRng(i).????.Address 'what should I put in place of ????
Next i

Any and all help appreciated.

-gk-


================================================== ======================
"The creative act is not the province of remote oracles or rarefied
geniuses but a transparent process that is open to everyone."
-Greg Kot in Wilco Learning How To Die-


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
Sumproduct Question Working With Start and End Date Range StonyfieldRob Excel Worksheet Functions 1 May 27th 10 10:36 PM
3d array not working D Excel Worksheet Functions 3 November 2nd 07 03:36 PM
array, range question mwam423 Excel Discussion (Misc queries) 4 August 23rd 07 01:36 AM
Array Formula Not Working with Range with Formulas [email protected] Excel Discussion (Misc queries) 4 February 1st 06 02:01 PM
Assigning range to array not working Marston Excel Programming 2 August 12th 04 11:38 PM


All times are GMT +1. The time now is 04:40 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"