What sort of "object" are you referring to? If the text of the
"object" is in a variable named S, you can use code like the
following. The first Replace removes all the underscore characters.
The loop single spaces the remaining text (converting 2 spaces to 1
space):
Dim S As String
Dim N As Long
S = "your string here"
S = Replace(S, "-", vbNullString)
N = InStr(1, S, Space(2))
Do Until N = 0
S = Replace(S, Space(2), Space(1))
N = InStr(1, S, Space(2))
Loop
Debug.Print S
Cordially,
Chip Pearson
Microsoft Most Valuable Professional
Excel Product Group, 1998 - 2009
Pearson Software Consulting, LLC
www.cpearson.com
(email on web site)
On Tue, 30 Dec 2008 13:37:34 -0800, TomP
wrote:
I have an object that is filled with many underscores between texts. I
recently got help from your forum on how to remove leading underscores which
works great and now I need help in replacing a line of underscores between
words with a single space.
Thank you again for your help!