ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Inputbox and & character (https://www.excelbanter.com/excel-programming/314204-inputbox-character.html)

MJR

Inputbox and & character
 
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!

Grey Newt[_4_]

Inputbox and & character
 
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



"MJR" wrote:

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!



All times are GMT +1. The time now is 05:35 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com