Replaceing a universal monetary symbol

L

Lena

Hi all
I have a listbox on my form that is populated using the contents of a table in another document. I'm using the users selection to replace a bookmark in yet another document. Right now when I hover over Me.listSelectedFunds.List(n) it shows two of these things "||" (don't know what they're called) at the end of the list item (or cell contents)... I believe they represent a paragraph marker and a universal monetary symbol? This is causing a break (ie new paragraph) in the text when I replace the bookmark
The following code gets rid of the paragraph mark

strEditedFundNames = Replace(Me.listSelectedFunds.List(n), Chr(10), ""

but I can't seem to find a chr equivalent of the other symbol (whatever it is)... I've been tempted to take the Len() subtract one and then take the Right().... it works, but it doesn't seem right
Any help would be greatly appreciated
Lena
 
Å

Åsa Holmgren

Hi Lena,

when I take the range out of a table cell I get the trailing characters 13
and 7 (not 10). I can't see any problems using:

strEditedFundNames = Left$(Me.listSelectedFunds.List(n),
Len(me.listSelectedFunds.List(n)) - 2)

or rather strip the two trailing characters off when populating the listbox.

/Asa

Lena said:
Hi all,
I have a listbox on my form that is populated using the contents of a
table in another document. I'm using the users selection to replace a
bookmark in yet another document. Right now when I hover over
Me.listSelectedFunds.List(n) it shows two of these things "||" (don't know
what they're called) at the end of the list item (or cell contents)... I
believe they represent a paragraph marker and a universal monetary symbol?
This is causing a break (ie new paragraph) in the text when I replace the
bookmark.
The following code gets rid of the paragraph mark:

strEditedFundNames = Replace(Me.listSelectedFunds.List(n), Chr(10), "")

but I can't seem to find a chr equivalent of the other symbol (whatever it
is)... I've been tempted to take the Len() subtract one and then take the
Right().... it works, but it doesn't seem right.
 
D

Doug Robbins - Word MVP

It's a worthless symbol <g>

Left() and Left$() are really the same when acting upon a string. I think.

In any event Left() should do what you want.

However, as Asa suggested, it would be better to strip the end of cell
marker from the data before populating the listbox. That can be done by
setting a variable declared as a Range to the .Range of the cell and then
using

[yourrangevariable].End = [yourrangevariable].End - 1

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
J

Jonathan West

Doug Robbins - Word MVP said:
It's a worthless symbol <g>

Left() and Left$() are really the same when acting upon a string. I
think.

Not quite.

Left$ returns a string. Left returns a Variant of subtype string. If you are
assigning the result of the function to a string variable, Left$ is
marginally the quicker function to use.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top