Detect UPPERCASE in cell value?
Give this a try...
Public Function IsUpper(ByVal cell As Range) As Boolean
If cell.Value = UCase(cell.Value) Then
IsUpper = True
Else
IsUpper = False
End If
End Function
--
HTH...
Jim Thomlinson
" wrote:
Fellow programmers... below is some code I tried to create to detect
if the contents of the ActiveCell.Value was all UPPERCASE. The
spreadsheet is importing data and if a cell's value is all updercase
it means something specific with the data that being imported. Any
ideas as to how to make a TRUE & FALSE statement based on the
characters being all uppdercase?
Declare Function IsCharUpper Lib "user32" Alias "IsCharUpperA" _
(ByVal cChar As Byte) As Long
Sub Button22221_Click()
If IsCharUpper(ActiveCell.Value) = True Then
MsgBox "It is bitch.", vbOKOnly, "-Test-"
End If
If IsCharUpper(ActiveCell.Value) = False Then
MsgBox "It's not uppercase.", vbOKOnly, "-Test 2-"
End If
End Sub
Thanks in advance!
|