假设你的字符串已经在变量s里面了:
Sub 按字符逆序输出大写字母()
Dim i As Integer, s As String
Dim x As Integer, c As String
Dim arr(1 To 26) As Integer
s = InputBox("输入字符串")
For i = 1 To 26
arr(i) = 0
Next i
For i = 1 To Len(s)
c = Mid(s, i, 1)
If c >= "A" And c <= "Z" Then
x = Asc(c) - Asc("A") + 1
arr(x) = arr(x) + 1
End If
Next i
c = ""
For i = 26 To 1 Step -1
If arr(i) > 0 Then c = c & Chr(Asc("A") + i - 1)
Next i
MsgBox "你的字符串中出现的大写字母有:" & c
End Sub