ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   is there a #? (https://www.excelbanter.com/excel-programming/373411-there.html)

Arne Hegefors

is there a #?
 
In my macro I get info from another program. If something has gone wrong then
the charachter # is found in the info. How can I write a short test to see if
that charachter is found in the info given? please help! thanks!

Gary''s Student

is there a #?
 
You can use InStr() to test for the presence of a character in a string:

Sub pound_test()
Dim s As String
s = "1234#5678"
If InStr(1, s, "#") 0 Then
MsgBox ("Pound found")
End If
End Sub

--
Gary's Student


"Arne Hegefors" wrote:

In my macro I get info from another program. If something has gone wrong then
the charachter # is found in the info. How can I write a short test to see if
that charachter is found in the info given? please help! thanks!


Bob Phillips

is there a #?
 
If the_value Like "*#*" Then
... error

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Arne Hegefors" wrote in message
...
In my macro I get info from another program. If something has gone wrong

then
the charachter # is found in the info. How can I write a short test to see

if
that charachter is found in the info given? please help! thanks!





All times are GMT +1. The time now is 10:31 AM.

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