You're looping within your "for/next" loop.
I wouldn't use a variable named count, either. It looks too much like the
..count property. It may not confuse excel, but it would confuse me:
Option Explicit
Sub testme()
Dim myCount ' counter
Dim people() As String 'array
Dim Row_Count As Long
Dim Max As Long
Dim i As Long
'find how many people listed in sheet 2 column A
Sheets("Sheet2").Select
Range("a1").Select
Selection.CurrentRegion.Select
Row_Count = Selection.Rows.count - 1 'Subtract header
Max = Row_Count 'array is this big
ReDim people(1 To Max) 'redim array
i = 0
For myCount = 1 To Max
If IsEmpty(ActiveCell.Value) Then
'skip it
Else
i = i + 1
people(i) = ActiveCell.Value
End If
ActiveCell.Offset(1, 0).Select
Next myCount
If i = 0 Then
MsgBox "no cells added"
Else
ReDim Preserve people(1 To i)
End If
End Sub
(E-Mail Removed) wrote:
>
> Dim count ' counter
> Dim people() As String 'array
>
> 'find how many people listed in sheet 2 column A
> Sheets("Sheet2").Select
> Range("a1").Select
> Selection.CurrentRegion.Select
> row_count = Selection.Rows.count - 1 'Subtract header
>
> Max = row_count 'array is this big
> ReDim people(1 To Max) 'redim array
>
> For count = 1 To Max
> While Not IsEmpty(ActiveCell)
> count = count + 1
> ActiveCell.Offset(1, 0).Select
> people(i) = ActiveCell.Value
> Wend
> Next count
--
Dave Peterson