Posted to microsoft.public.excel.programming
|
|
Like Operator vs Regular Expressions
HI,
you can use vbscripts regular expression function like this..
Sub DelIt()
Dim re As Object, cell As Range
Set re = CreateObject("VBScript.Regexp")
re.Pattern = "(-[^-]*){3}$"
For Each cell In Selection
cell.Offset(0, 1).Value = re.Replace(cell.Value, "")
Next
End Sub
M$ Documentation:
http://msdn.microsoft.com/library/de.../en-us/script5
6/html/vsobjregexp.asp
Hth,
OJ
|