Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default 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
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
Can a cell refer to range name/array of data previously set? Courreges Excel Discussion (Misc queries) 1 June 12th 06 02:45 PM
Read through Range and copy Cell data to Array missleigh[_2_] Excel Programming 1 April 13th 06 12:47 PM
How do i read Selection.Shapes.Range(Array(i)? Harry Excel Programming 2 September 6th 05 03:46 PM
Read a range to an array Microsoft Forum Excel Programming 4 January 23rd 05 05:23 PM
Read Range Data into Array Stratuser Excel Programming 1 April 26th 04 06:46 PM


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

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

About Us

"It's about Microsoft Excel"