Try the attached
Option Explicit
Sub test()
Dim r As Range, ODL, ODW, IDW
With CreateObject("VBScript.RegExp")
For Each r In Range("j2", Range("j" & Rows.Count).End(xlUp))
.Pattern = ".* ([\d\.]+).* X ([\d\.]+).* ?(ID).*"
If .test(r.Value) Then
ODL = .Replace(r.Value, "$1")
IDW = .Replace(r.Value, "$2")
Else
.Pattern = ".* ([\d\.]+).* ?SQ(UARE)?.*"
If .test(r.Value) Then
ODL = .Replace(r.Value, "$1")
ODW = ODL
Else
.Pattern = ".* ([\d\.]+).* X ([\d\.]+).*"
If .test(r.Value) Then
ODL = .Replace(r.Value, "$1")
ODW = .Replace(r.Value, "$2")
End If
End If
End If
r(, 2).Resize(, 3) = Array(ODL, ODW, IDW)
ODL = "": ODW = "": IDW = ""
Next
End With
End Sub
Bookmarks