VBA code to test if a cell is all upper case

This tests to see if a cell is ALL UPPER CASE. If so, it replaces the cell with “UpperCase”. If not, it replaces the cell with “NonUpperCase”. This hasn’t been extended to write these values to different cells, so copy the original cells somewhere, select them, then run this:

Sub UppercaseTest()
Dim aRng As Range
Dim aCell As Range
Set aRng = Selection
For Each aCell In aRng

If aCell.Value = UCase(aCell.Value) Then
 aCell.Value = "UpperCase"
 Else: aCell.Value = "NonUpperCase"
End If

Next aCell
Set aRng = Nothing
End Sub