Try simplifying your IF statement:If Right(sHold, 2) = "01" ThensHold = Left(sHold, Len(sHold) - 2) * 2ElseIf Right(sHold, 2) = "02" ThensHold = sHold * 2 + 1ElsesHold = sHoldEnd If