Function RemoveUpperW(s As String)
With CreateObject("VBScript.RegExp")
.Pattern = "\b[A-Z]+\b"
.Global = True
RemoveUpperW = Application.Trim(.Replace(s, ""))
End With
End Function
HOW TO INSTALL UDFsThank you for your help! But i'm completely new at excel and i don't know how to use udf, i only know how to use macros.
It should not have given you an error. I am wondering if you specified the wrong argument? I notice you mentioned "selection" in your original message... the UDF (user defined function) that pgc posted can only work on one cell at a time. When I gave you this example...Hi Rick:
Thank you for trying to help me, i did the whole process that you have posted, but it still gives me error.
Regular Expressions (what pgc used to create his solution) is not something I work with, but I believe this conversion of his UDF to a macro should work correctly. Select all the cells (as a contiguous range) that you want to process first, then run this macro...Isn't there any macro for this? because macro are the only thing that i can use...
Sub RemoveUpperCaseWords()
Dim R As Long, C As Long, Data As Variant
Data = Selection
With CreateObject("VBScript.RegExp")
.Pattern = "\b[A-Z]+\b"
.Global = True
For R = 1 To UBound(Data, 1)
For C = 1 To UBound(Data, 2)
Data(R, C) = Application.Trim(.Replace(Data(R, C), ""))
Next
Next
End With
Selection = Data
End Sub