Livin404
Well-known Member
- Joined
- Jan 7, 2019
- Messages
- 774
- Office Version
- 365
- 2019
- Platform
- Windows
Greetings,
I'm trying to decode a alpha numeric code. I have several MACROS and they work fine. I know for example
. That a letter or number within the first braces combined with a letter in the second braces and finally combined with a letter in the third braces will get be the desired text. What I would really like to know: Suppose I have a group of letters/numbers that now rather than a single letter or numbe the macros will look for a pair of letters or numbers. In the example below suppose rather than [HXZWJURYANM] the 3 & 4 characters have to be in pairs preceeded by the braces with single digits, for example (01), (WC), (32) etc.. Again the formula is good below, I just need a little tweak.
Thank you very much indeed.
I'm trying to decode a alpha numeric code. I have several MACROS and they work fine. I know for example
Excel Formula:
If Data(R, 1) Like "[145678CDJKQXYZF][JPVM][HXZWJURYANM]*"
Thank you very much indeed.
VBA Code:
Sub Valid_Access()
Dim R As Long, Data As Variant, Result As Variant
Data = Range("B1", Cells(Rows.Count, "B").End(xlUp)).Value
Result = Range("F1").Resize(UBound(Data)).Value
For R = 1 To UBound(Data)
If Data(R, 1) Like "[145678CDJKQXYZF][JPVM][HXZWJURYANM]*" Then
Result(R, 1) = Result(R, 1) & Mid("/Valid Access with Proper ID", 1 - (Result(R, 1) = ""))
End If
Next
Range("F1").Resize(UBound(Result)) = Result
End Sub