G
Guest
Hi! I have a part of a code that reads names from a long list. The length of
the list changes from time to time but the boundaries are given by the range
"position". Now I read the entire range but I want it to only read the rows
the are non empty. when the first empty rows comes then i want it to stop.
Thus the problem is the the row: Nop = rngPositions.Rows.Count
or somewhere related to that but I dont know how to get it right. pls help!
Dim rngPositions As Range
Set rngPositions =
Application.ThisWorkbook.Sheets("Data").Range("position")
Dim Nop As Long
Nop = rngPositions.Rows.Count
ReDim Positions(1 To Nop) As Double
Dim i As Integer
For i = 1 To Nop
Positions(i) = rngPositions.Cells(i, 1)
Next i
the list changes from time to time but the boundaries are given by the range
"position". Now I read the entire range but I want it to only read the rows
the are non empty. when the first empty rows comes then i want it to stop.
Thus the problem is the the row: Nop = rngPositions.Rows.Count
or somewhere related to that but I dont know how to get it right. pls help!
Dim rngPositions As Range
Set rngPositions =
Application.ThisWorkbook.Sheets("Data").Range("position")
Dim Nop As Long
Nop = rngPositions.Rows.Count
ReDim Positions(1 To Nop) As Double
Dim i As Integer
For i = 1 To Nop
Positions(i) = rngPositions.Cells(i, 1)
Next i