Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Using Arrays in Excel

Status
Not open for further replies.

pcdaveh

Technical User
Sep 26, 2000
213
US
What is the proper format to read values from excel into an Array. What I'm doing so far isn't working:
I'm just trying to read Column "A" Rows 1 to N


Sub Findduplicates()

Dim DataColumn()
Dim DataColumnElement()
Dim i As Long
Static lastRow As Integer
Dim IRow As Integer

call GetRealLastCell

lastRow = lRealLastRow
ReDim Preserve DataColumn(1 To lastRow)
For i = 1 To lRealLastRow

DataColumn = Range("A" & lastRow).Text

Next i

End Sub
 
Can't say I know the proper method.... but this works.

Dim DataArray(1000) As Variant

For RowNum = 1 to 1000
DataArray(RowNum) = ActiveSheet.Columns(1).Rows(RowNum)
Next R

Looks like you can easily modify from here.....

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top