ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Islike function (https://www.excelbanter.com/excel-programming/289135-islike-function.html)

Jamie[_6_]

Islike function
 
Hi All,

I want to put the following format as a requirement for
data entry via a userform:

123/4567-K

three numbers, a slash, four numbers, a dash follwed by a
letter.

I have tried ###/####-[A-Z]. It seems that I can not get
the slash and the dash. I am not sure of their format in
VB. Any help is appreciated. Thank you in advance.

Daniel Klann

Islike function
 
Hi,

This worked OK for me:-

Sub ValidateText()

Dim x

x = InputBox("Enter text")

If x Like "###/####-[A-Z]" Then
Debug.Print "Valid"
Else
Debug.Print "Invalid"
End If

End Sub

If you can't get this to work then you could try surrounding the / and - in
square brackets [ ].

Regards,
Daniel

http://www.danielklann.com


"Jamie" wrote in message
...
Hi All,

I want to put the following format as a requirement for
data entry via a userform:

123/4567-K

three numbers, a slash, four numbers, a dash follwed by a
letter.

I have tried ###/####-[A-Z]. It seems that I can not get
the slash and the dash. I am not sure of their format in
VB. Any help is appreciated. Thank you in advance.




jamie

Islike function
 
Hi Daniel,

Thank your your reply. I must be doing something wrong. It
does not work on Excel 97 even with []. I will test it on
Excel 2k tonight. Thanks again for your help.

-----Original Message-----
Hi,

This worked OK for me:-

Sub ValidateText()

Dim x

x = InputBox("Enter text")

If x Like "###/####-[A-Z]" Then
Debug.Print "Valid"
Else
Debug.Print "Invalid"
End If

End Sub

If you can't get this to work then you could try

surrounding the / and - in
square brackets [ ].

Regards,
Daniel

http://www.danielklann.com


"Jamie" wrote in

message
...
Hi All,

I want to put the following format as a requirement for
data entry via a userform:

123/4567-K

three numbers, a slash, four numbers, a dash follwed by

a
letter.

I have tried ###/####-[A-Z]. It seems that I can not get
the slash and the dash. I am not sure of their format in
VB. Any help is appreciated. Thank you in advance.



.


Bob Phillips[_6_]

Islike function
 
Jamie,

For info, it works on my Excel 2000, XP.

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"jamie" wrote in message
...
Hi Daniel,

Thank your your reply. I must be doing something wrong. It
does not work on Excel 97 even with []. I will test it on
Excel 2k tonight. Thanks again for your help.

-----Original Message-----
Hi,

This worked OK for me:-

Sub ValidateText()

Dim x

x = InputBox("Enter text")

If x Like "###/####-[A-Z]" Then
Debug.Print "Valid"
Else
Debug.Print "Invalid"
End If

End Sub

If you can't get this to work then you could try

surrounding the / and - in
square brackets [ ].

Regards,
Daniel

http://www.danielklann.com


"Jamie" wrote in

message
...
Hi All,

I want to put the following format as a requirement for
data entry via a userform:

123/4567-K

three numbers, a slash, four numbers, a dash follwed by

a
letter.

I have tried ###/####-[A-Z]. It seems that I can not get
the slash and the dash. I am not sure of their format in
VB. Any help is appreciated. Thank you in advance.



.




Ify

Islike function
 
Thank you Mr Norman for helping me with the sumproduct function.

Please I would like any one to help me on how to use ISLIKE formular t
make a search for likely names in my list.
I have tried ISLIKE(text,pattern) and it did not work

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


Frank Kabel

Islike function
 
Hi
have a look at the FIND / SEARCH function.
e.g.
=IF(ISNUMBER(FIND(pattern,text)),"pattern in text","pattern not in
text")

--
Regards
Frank Kabel
Frankfurt, Germany


Thank you Mr Norman for helping me with the sumproduct function.

Please I would like any one to help me on how to use ISLIKE formular
to make a search for likely names in my list.
I have tried ISLIKE(text,pattern) and it did not work .


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




All times are GMT +1. The time now is 09:55 PM.

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