Answer the question
In order to leave comments, you need to log in
Answer the question
In order to leave comments, you need to log in
There are 2 options - look for specific characters using SEARCH () and slicing the string using MID () or use regular expressions
Public Function RegExpExtract(sText As Variant, Pattern As String) As Variant
On Error GoTo ErrHandl
Text = CStr(sText)
Dim regex As New RegExp ' создаем экземпляр RegExp
regex.Pattern = Pattern
regex.Global = False
If regex.test(Text) Then
Set matches = regex.Execute(Text)
RegExpExtract = matches.Item(0).SubMatches(0)
Exit Function
End If
ErrHandl:
RegExpExtract = ""
'RegExpExtract = "#" & err.Number & "> " & err.Description
End Function
press off
interested in regular expression formulas for each cell.
Функции регулярных выражений в Excel
For each cell, depending on the characters:
=MID(cell;SEARCH("City: "+n;cell);SEARCH("Name/store:";cell)-SEARCH("City: "+t;cell)+n )
Cell - a link to the cell,
+ n - signs will be determined by selection, if without complicating the formula)
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question