If there isn't a "-" in the cell.value, the Left function would error because its End argument would be -1

Try something like this...
    If InStr(1, Cells(a, b).Value, "-") - 1 > 0 Then
        o = Left(Cells(a, b).Value, (InStr(1, Cells(a, b).Value, "-") - 1))
    End If