Inputbox and & character

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I'm using an inputbox to get a search string from a user. I'd like the
result to be interpreted literally. As it is, if a user happens to enter an
ampersand (&) symbol (which is a legitimate entry in this case) the symbol is
discarded, and the text on either side is concactenated. Is there a simple
work around for this, or do I need to capture this (and other?) symbols
programatically.

BTW, this is just my first post, but this is the second place place I look
for answers to my MS Office questions. The first, of course, is the help
files. Thanks!
 
Look at using Replace in VBA to replace any "&" characters with whatever you
need - perhaps something like " & ""&"" & " depending on what search string
format you need.

Search_String=Replace(expression, find, replace)

Martin
 

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

Back
Top