Home |
Search |
Today's Posts |
|
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Read through Range and copy Cell data to Array
I am trying to calculate status of a range based on:
When Data is present in Col1, Select Cell data for Col1 & Col 3 of same row and write it to an arrary. I'd appreciate any help or direction with this. I've tried to set it up to: Read through a range of cells (currently A2:J13), and where A1 is not empty, select the contents of A2 and E2 and write them to an array. So far I have: Sub TestStatusArray() Dim TestCaseID As String Dim Status As Boolean Dim R As Integer R = 2 Do While Not (IsEmpty(Cells(R, 1))) Cells(R, 1).Copy << getting lost here Loop End Sub I can't seem to figure out how to extract the contents of the cells and and write A2 to TestCaseID and E2 to Status. Ideally, this data will then later be populated on a separate worksheet. I welcome any suggestions/recommendations/reading links. Thanks, Leigh |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Read through Range and copy Cell data to Array
leigh try Sub TestStatusArray() Dim Col1() As String ' create a resizable array Dim Col3() As String ' create a resizable array Dim Rng As Range Dim iCnt As Integer iCnt = -1 'loop through column A range For Each Rng In Range("a1:a13") If Not IsEmpty(Rng) Then iCnt = iCnt + 1 'resize arrays ReDim Preserve Col1(iCnt) ReDim Preserve Col3(iCnt) 'populate arrays Col1(iCnt) = Rng.Value Col3(iCnt) = Rng.Offset(0, 2).Value End If Next Rng End Sub Please note you can also create a fixed size array by using Dim Col1(13) As String -- mudraker ------------------------------------------------------------------------ mudraker's Profile: http://www.excelforum.com/member.php...fo&userid=2473 View this thread: http://www.excelforum.com/showthread...hreadid=532469 |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can a cell refer to range name/array of data previously set? | Excel Discussion (Misc queries) | |||
Read through Range and copy Cell data to Array | Excel Programming | |||
How do i read Selection.Shapes.Range(Array(i)? | Excel Programming | |||
Read a range to an array | Excel Programming | |||
Read Range Data into Array | Excel Programming |