Search code examples
excelsharepoint-2010excel-2010vba

Excel VBA code to upper case all cells


Goal:
The goal is to gain the result from the picture below

enter image description here

Problem:
The current situation is below

How should I do it in order to gain the result in the goal by using VBA code.

enter image description here


Solution

  • Try this code

    Sub sample()
     Range("B4:E7") = [index(upper(B4:E7),)]
    End Sub
    

    enter image description here