VBA - UCase

A função UCase retorna a string após converter a string inserida em letras maiúsculas.

Sintaxe

UCase(String)

Exemplo

Adicione um botão e coloque a seguinte função dentro do mesmo.

Private Sub Constant_demo_Click()
   var = "Microsoft VBScript"
   msgbox("Line 1 : " & UCase(var))
   
   var = "MS VBSCRIPT"
   msgbox("Line 2 : " & UCase(var))
   
   var = "microsoft"
   msgbox("Line 3 : " & UCase(var))
End Sub

Ao executar o script acima, ele produz a seguinte saída.

Line 1 : MICROSOFT VBSCRIPT
Line 2 : MS VBSCRIPT
Line 3 : MICROSOFT