Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default 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.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default 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.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default 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.



.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default 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.



.



  #5   Report Post  
Posted to microsoft.public.excel.programming
Ify Ify is offline
external usenet poster
 
Posts: 1
Default 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



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default 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/


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel Data Validation/Lookup function does function correcty Kirkey Excel Worksheet Functions 2 May 25th 09 09:22 PM
LINKEDRANGE function - a complement to the PULL function (for getting values from a closed workbook) [email protected] Excel Worksheet Functions 0 September 5th 06 03:44 PM
Offset function with nested match function not finding host ss. MKunert Excel Worksheet Functions 1 March 21st 06 10:46 PM
Emulate Index/Match combo function w/ VBA custom function Spencer Hutton Excel Worksheet Functions 2 May 2nd 05 05:26 PM
Adding a custom function to the default excel function list DonutDel Excel Programming 3 November 21st 03 03:41 PM


All times are GMT +1. The time now is 07:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"