Try
Sub addfinalnum_Upda()
Dim cel As Range
Dim fst&, lst&, pos&
Application.ScreenUpdating = False
For Each cel In Range("E2:E" & Cells(Rows.Count, 5).End(xlUp).Row)
If InStr(cel, "#") > 1 Then
fst = InStr(cel, "#")
lst = InStrRev(cel, "#")
If fst <> lst Then
pos = Mid(cel, fst + 5, 1) 'Remove this line if want it to work like example, not description
cel.Value = cel.Value & pos 'Remove this line if want it to work like example, not description
cel.Offset(, -1).Value = Mid(cel, lst + 1)
ElseIf fst = lst Then
cel.Offset(, -1).Value = Mid(cel, lst + 1)
End If
End If
Next
Application.ScreenUpdating = True
End Sub
Note: in your initial description, you outline two steps:
Now add last digit from #x1126 to #9112
So you will have
"06/07/21 Check #x1126 #91126"
Now take digit part of #91126 and put in column D same row.
But your example only shows the second step. Should the outcome be like the description or your example? My code carries out the two steps in your description method.
Bookmarks