rrhandle8
asked on
Type Mismatch error Excel VBA
The Do While line keeps giving error message "Type Mismatch".
Sub MostActiveDayPrediction()
Dim r As Integer
Dim rng As Excel.Range
Sheets("Stats").Activate
r = 1
Set rng = Sheets("Yahoo_Download_2").Range("Results_OEX")
Do While rng.Offset(r, 0) <> ""
If rng.Offset(r, 0) = Sheets("Stats").Range("Last_Monday") Then Stop
r = r + 1
Loop
End Sub
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks, byundt.
I see my mistake. The range contains multiple rows and columns. You cannot use .offset when selecting a range that size. I should have set the range name to just the top left cell.
Thanks for making me think.
I see my mistake. The range contains multiple rows and columns. You cannot use .offset when selecting a range that size. I should have set the range name to just the top left cell.
Thanks for making me think.
If the cell contains a blank, text or a number, it executes fine.