I'm sure you know, but keep in mind that the following difference between IsNull and IsEmpty Excel Help reminds us that:
IsNull → Returns a boolean value indicating whether the expression contains invalid data (Null). IsEmpty → Returns a boolean value indicating whether the variable was initialized.
Well, that being said, I fixed your problem of inability to read values. I put the range you are looking at into an array variant. Now msgbox in a loop will return you the value.
Sub x() Dim Arr As Variant Arr = Worksheets("Sheet1").Range(Cells(1, 16), Cells(1000, 16)).Value 'You can modify the 1000 by finding the last line, eg - Range.End(xldown).Row Dim i i = 1 Dim CurrentPos CurrentPos = Arr(i, 1) Do Until IsEmpty(Arr(i, 1)) Or IsNull(Arr(i, 1)) MsgBox CurrentPos Loop End Sub
What do you guys think?
source share