Gurus,
please see below for codes that return byref argument type mismatch,. I'm confused about what went wrong. Thanks!
please see below for codes that return byref argument type mismatch,. I'm confused about what went wrong. Thanks!
VBA Code:
Function GetLett(rng As Range)
Dim strTemp As String
Dim n As Long
For n = 1 To Len(rng)
Select Case Asc(Mid((rng), n, 1))
Case 65 To 90, 97 To 122
strTemp = strTemp & Mid((rng), n, 1)
End Select
Next
GetLett = strTemp
End Function
Sub ajsdiajsdiajdij()
For Each cell1 In Range("a6", "a23")
If GetLett(cell1) = "ABC" Or "CBA" Then
MsgBox "y"
End If
Next cell1
End Sub