I used the below code to populate an array with values from active cell up 8 rows. I now want to check if all values in the array are either greater than or less than a specific value in worksheet, let's say the check value resides in cell "A1" for simplicity.
Any help would be greatly appreciated.
Dim sampleArr() As Variant
Dim i As Integer
Dim rng As Range, cel As Range
i = 1
Set rng = Range(ActiveCell, ActiveCell.Offset(-8, 0))
'Set rng = ActiveCell.Range.Offset(0, 0).Resize(0, -8) ' Note, this creates a 2 Dimensional array
sampleArr = rng ' Right here, this sets the values in the range to this array.
For i = LBound(sampleArr) To UBound(sampleArr)
Debug.Print sampleArr(i, 1) ' you need the ",1" since this is 2D.
Next i
Bookmarks