-
A UDF like this should work. You can reject measurments by using the rejectPattern arguments,
as in =ExtractMixed(A1, "*#in*", "*#cm*")
[VBA]Function ExtractMixed(DelimitedString As String, ParamArray RejectionPatterns() As Variant) As String
Dim i As Long
Dim oneSubString As Variant
For Each oneSubString In Split(DelimitedString, "-")
If (LCase(oneSubString) Like "*[a-z]*") And (oneSubString Like "*#*") Then
ExtractMixed = oneSubString
For i = 0 To UBound(RejectionPatterns)
If LCase(oneSubString) Like LCase(RejectionPatterns(i)) Then
ExtractMixed = vbNullString
End If
Next i
If ExtractMixed <> vbNullString Then Exit Function
End If
Next oneSubString
End Function[/VBA]
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules