6,210
社区成员
发帖
与我相关
我的任务
分享
Function 房号(a As Range)
Dim b As Object
Application.Volatile
With CreateObject("vbscript.regexp")
.Global = True
.Pattern = "(\d+)(?=[幢|层|库|座|号|路|房|卡])"
Set b = .Execute(a.Value)
If .test(a.Value) Then
房号 = b.Item(b.Count - 1)
Else
房号 = 1
End If
End With
End Function