In this article, we are going to see how to convert the selected range to uppercase using Macros in Excel Office 365. Macros and VBA is an interesting area in Excel. If you want to know how to do this task on your Excel worksheet, then follow the below instructions given in this article.
Convert Selection to Uppercase using Macros:
Kindly, follow the below steps to convert the selection to uppercase using the Macros concept.
- In the below screenshot, we have shown you the input selection range from B1:B5. Let’s convert them into UPPERCASE with the help of macros.
- On the Developer Tab, select the Visual Basic option under the Code section.
- Then you need to copy and paste the code given below.
VBA code to convert selection to uppercase using Macros
Sub ConvertToUpperCase()
Dim rng As Range
For Each rng In Selection
If Application.WorksheetFunction.IsText(rng) Then
rng.Value = UCase(rng)
End If
Next
End Sub
- You need to save the code by selecting it. Then close the window.
- You have to open the sheet containing the data. On the Developer Tab, choose the Macros option in the Code section.
- You need to make sure that your macro is selected and click the Run button.
- At last, you can get the output as shown in the below image. The selection range has been converted to uppercase.
Sum-Up:
In the above article, you can clearly understand the steps to convert selection to uppercase using Macros in Excel Office 365. Leave your worthwhile feedback with us in the below comment section. Thanks for visiting Geek Excel. Keep Learning!
Top comments (0)