Something like this maybe
Sub timas()
Dim i As Long
For i = Range("B" & Rows.Count).End(3).Row To 2 Step -1
If InStr(1, Cells(i, "B").Value, "Rail bracket", vbTextCompare) > 0 Then
Select Case ExtractNumber(Cells(i, "B"))
Case Is = "63"
Cells(i, "A") = 227372063
Case Is = "75"
Cells(i, "A") = 227372075
Case Is = "90"
Cells(i, "A") = 227372090
End Select
End If
Next i
'40 - 227372040
'50 - 227372050
'56 - 227372056
'63 - 227372063
'75 - 227372075
'90 - 227372090
'110 - 227372110
'125 - 227372125
'160 - 227372160
'200 - 227372200
'250 - 227372250
End Sub
Function ExtractNumber(rC As Range) As String
With CreateObject("VBSCRIPT.REGEXP")
.Pattern = "[^0-9]"
.Global = True
.IgnoreCase = True
ExtractNumber = .Replace(rC.Value, "")
End With
End Function
Bookmarks