How to Convert Selection to UPPERCASE using Macros in Excel?
Tags: convertselectiontoup, vbamacros
Published: 2021-02-15 04:20:40

---
title: How to Convert Selection to UPPERCASE using Macros in Excel?
published: true
date: 2021-02-13 11:20:06 UTC
tags: Convertselectiontoup,VBAMacros
canonical_url: https://geekexcel.com/how-to-convert-selection-to-uppercase-using-macros-in-excel/
---

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](https://geekexcel.com/excel-office-365-vba-overview-definition-and-examples/) 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](https://geekexcel.com/how-to-filter-cells-by-uppercase-or-lowercase-in-excel/) with the help of macros.

![Example](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_VZdOUYUwLx.png)<figcaption id="caption-attachment-21840">Example</figcaption>

- On the **Developer Tab, select** the **Visual Basic** option under the **Code** section.

![Select Visual Basic option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Select-Visual-Basic-option-4.png)<figcaption id="caption-attachment-14755">Select the Visual Basic option</figcaption>

- 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.**

![Enter the code](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_JrQLmGimKw.png)<figcaption id="caption-attachment-21841">Enter the code</figcaption>

- You have to open the sheet containing the data. On the **Developer Tab, choose** the **Macros option** in the **Code** section.

![Choose the Macros option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2020/09/Choose-the-Macros-option-2.png)<figcaption id="caption-attachment-14747">Choose the Macros option</figcaption>

- You need to make sure that your macro is selected and **click** the **Run** button.

![Click the Run button](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_DD478WBvGf.png)<figcaption id="caption-attachment-21842">Click the Run button</figcaption>

- At last, you can get the output as shown in the below image. The selection range has been converted to uppercase.

![Output](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/02/EXCEL_bRHFrFczKO.png)<figcaption id="caption-attachment-21843">Output</figcaption>

## **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.](https://geekexcel.com/)** Keep Learning!

#### Keep Reading:

- [Convert Formulas into Values using Macros (VBA) in Excel 365!!](https://geekexcel.com/convert-formulas-into-values-using-macros-vba-in-excel-365/)
- [Remove Extra Spaces from Selection Using Macros (VBA) in Excel!!](https://geekexcel.com/remove-extra-spaces-from-selection-using-macros-vba-in-excel/)
- [Add a Degree Symbol to Selection Range using Macros (VBA) in Excel!](https://geekexcel.com/add-a-degree-symbol-to-selection-range-using-macros-vba-in-excel/)
- [Resize All Charts using Macros (VBA) in Excel Office 365!!](https://geekexcel.com/resize-all-charts-using-macros-vba-in-excel-office-365/)