Public Sub EditCodeMashin() Dim Cell As Range Dim Soob As String On Error Resume Next For Each Cell In Selection Soob = Trim$(Cell.Value) If Len(Soob) = 7 Then Soob = Left$(Soob, 2) & Right$(Soob, 4) Cell.Value = Soob Else If Len(Soob) = 5 Then Soob = «0» & Soob Cell.Value = Soob End If End If Next End Sub