Hi all, thank you so much for helping me
For John55
Hi, thanks a lot John. But, there's problem in this code, but I don't know what is it. I've tried to use this vba but it doesn't work.
For nilem
Hi, thank u so much for your help. It really works, thank u . But, would you mind if this code works for entire column, not just for column A? Thanks a lot nilem.
Sub ertert()
Dim rng As Range, r As Range, s$, i&
Set rng = Range("A1:A" & Cells(Rows.Count, 1).End(xlUp).Row)
With CreateObject("VBScript.RegExp")
.Global = True: .IgnoreCase = True
.Pattern = "X([0-9.]+X)+"
For Each r In rng
s = LCase(r.Value)
With .Execute(s)
For i = 0 To .Count - 1
s = Mid(s, 1, .Item(i).firstindex + 1) & Replace(s, "x", ".", .Item(i).firstindex + 2, 2)
Next
End With
r.Value = s
Next r
End With
End Sub
For jindon
Hi, thank u for helping me. It works in my worksheet. But, It seems this code works just for function number 2. The function for changing capital letter of "X" to "x" (lower) doesn't exist. Would you mind to add the first function in to this code? Thanks a lot.
Sub test()
Dim r As Range, x, i As Long
With CreateObject("vbscript.regexp")
.IgnoreCase = True
.Pattern = "(.*)(x)(.*)(\2)(.*)"
For Each r In Range("a1", Range("a" & Rows.Count).End(xlUp))
x = Split(r.Value, "/")
For i = 0 To UBound(x)
Do While .test(x(i))
x(i) = .Replace(x(i), "$1x$3.$5")
Loop
Next
r.Value = Join$(x, "/")
Next
End With
End Sub
Thank you for helping me
Regards,
Jasa
Bookmarks