Love this forum. Quick question guys. I am writing a public function, and I can't figure out how to select the approprate cell to start the loop. - i.e., when i step through the code, it looks like cell A2 in the "Options" worksheet is not being selected.
Any ideas? Thanks!
Public Function optionStatus(symbol As Variant, thedate As Date)
Dim statusFlag As Variant
statusFlag = 1
Sheets("Options").Select
Range("A2").Select
Do
If ActiveCell.Value = symbol Then
If thedate > ActiveCell.Offset(0, 1) And thedate <= ActiveCell.Offset(0, 2) Then
statusFlag = 0
ActiveCell.Offset(1, 0).Select
Else:
End If
Else: ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = ""
optionStatus = statusFlag
End Function
Any ideas? Thanks!
Public Function optionStatus(symbol As Variant, thedate As Date)
Dim statusFlag As Variant
statusFlag = 1
Sheets("Options").Select
Range("A2").Select
Do
If ActiveCell.Value = symbol Then
If thedate > ActiveCell.Offset(0, 1) And thedate <= ActiveCell.Offset(0, 2) Then
statusFlag = 0
ActiveCell.Offset(1, 0).Select
Else:
End If
Else: ActiveCell.Offset(1, 0).Select
End If
Loop Until ActiveCell = ""
optionStatus = statusFlag
End Function