How about If UBound(bytSensorID) > 0 Then