ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   search formula for 1st space (https://www.excelbanter.com/excel-programming/297247-search-formula-1st-space.html)

crew3407[_4_]

search formula for 1st space
 
hello,

I'm trying to enter in a search formula in vba, but i'm having troubl
with the syntax because i'm using 2 sets of parentheses.

Range("A1").Formula = "=SEARCH(" ",B1,1)"

there is a problem because i want to search for the first space in
sentence, but in the editor, it is recognizing the first two set o
parentheses and then the second set, expecting me to concatenate th
two strings. how can i fix this? Thank

--
Message posted from http://www.ExcelForum.com


DSC[_20_]

search formula for 1st space
 
HI

where you have Double Quote marks in your formula just use
"" Instead of "

so your example would become

Range("A1").Formula = "=SEARCH("" "",B1,1)"


HTH

Davi

--
Message posted from http://www.ExcelForum.com


crew3407[_5_]

search formula for 1st space
 
thanks

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 09:47 AM.

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