LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default RegEx Check password string

Also maybe just try [A-Za-z0-9]{7,15}

Tim


"Tim Williams" <saxifrax at pacbell dot net wrote in message
...
EM,

Any reason you're testing the range's Formula instead of the Value ?

Tim

"ExcelMonkey" wrote in message
...
Can someone tell me why this is not working. I am trying to test a
string to
see if it has a combination of letters and numbers from 7-15 characters
long.

Thanks

Public Function CheckPassword(rng As Range) As Variant
Dim reg As Object
'Checks for password with
Set reg = CreateObject("VBScript.RegExp")
With reg
.Pattern = "^(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9]).{7,15}$"
CheckPassword = .test(rng.Formula)
End With
End Function





 
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
Check for NON-presence of a string in another string G.P.N.L. c.v.a. Excel Worksheet Functions 4 December 11th 09 06:10 PM
VBA - Check for password protection MattShoreson[_47_] Excel Programming 6 December 16th 05 04:45 AM
password protected a check box Glendon MacBurnie Excel Worksheet Functions 0 January 27th 05 07:52 PM
username & password check Jack Excel Programming 5 October 8th 04 03:20 PM
regex string matching Jamie Martin[_2_] Excel Programming 3 September 26th 03 09:28 PM


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

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

About Us

"It's about Microsoft Excel"