how to Convert Small Letters into Uppercase for Some Columns in VBA?
Tags: toconvertsmallletter, vbamacros
Published: 2021-09-22 09:34:45

---
title: how to Convert Small Letters into Uppercase for Some Columns in VBA?
published: true
date: 2021-09-17 12:04:47 UTC
tags: ToConvertSmallLetter,VBAMacros
canonical_url: https://geekexcel.com/how-to-convert-small-letters-into-uppercase-for-some-columns-in-vba/
---

In this tutorial, we will guide you on how to ** convert small letters into uppercase for some columns ** in Excel VBA. Let’s get them below!! Get an official version of MS Excel from the following link: **[https://www.microsoft.com/en-in/microsoft-365/excel](https://www.microsoft.com/en-in/microsoft-365/excel)**

## Example

- Firstly, you need to  **create a sample data**  with  **small letters**  in the Excel Spreadsheet.

![](https://geekexcel.com/wp-content/uploads/2021/09/Sample-data-20.png)<figcaption>Sample data</figcaption>

- In the Excel Worksheet, you have to go to the  **Developer Tab.**
- Then, you need to ** ** select the  **Visual Basic**  option under the  **Code**  section.

![Select Visual Basic](https://geekexcel.com/wp-content/uploads/2021/09/Select-Visual-Basic-9-1024x180.png)<figcaption>Select Visual Basic</figcaption>

- Now, you have to  **copy and paste the code**  given below.

```
Private Sub Worksheet_Change(ByVal Target As Excel.Range)
If Target.Column = 4 Or Target.Column = 6 Or Target.Column = 9 _
Or Target.Column = 12 Or Target.Column = 13 Then Exit Sub
On Error GoTo ErrHandler
Application.EnableEvents = False
Target.Formula = UCase(Target.Formula)
ErrHandler:
Application.EnableEvents = True
End Sub

```

- You need to  **save the code**  by selecting it and then  **close the window**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Save-the-Code-47.png)<figcaption>Save the Code</figcaption>

- Again, you have to go to the  **Excel Spreadsheet** , and click on the  **Developer Tab**.
- You need to choose the  **Macros option**  in the Code section.

![Choose Macro option](https://geekexcel.com/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Now, you have to make sure that your  **macro name is selected**  and click the  **Run ** button.
- Here, you do not want to run the code on columns **4, 6, 9, 12, & 13** i.e. if any text is **entered in these columns** then the code will not be triggered.
- Finally, you will receive the  **output ** in the  **Microsoft Excel**.

![](https://geekexcel.com/wp-content/uploads/2021/09/Output-21.png)<figcaption>Output</figcaption>

## End of Era

We hope that this tutorial gives you guidelines on how to ** convert small letters into uppercase for some columns ** in Excel VBA **. ** Please leave a comment in case of any  **queries,**  and don’t forget to mention your valuable  **suggestions**  as well. Thank you so much for Visiting Our Site!! Continue learning on **[Geek Excel](https://geekexcel.com/)!! **Read more on [**Excel Formulas**](https://geekexcel.com/excel-formula/) **!!**

**Read Next:**

- **[How to use the XNPV function in Excel office 365?](https://geekexcel.com/how-to-use-the-xnpv-function-in-excel-office-365/)**
- **[Excel Formulas to Highlight the Cells that End with Given Value!!](https://geekexcel.com/excel-formulas-to-highlight-cells-end-with/)**
- **[Shortcut for “Select to End of Cell” in the Worksheet!!](https://geekexcel.com/quick-excel-shortcut-for-select-to-end-of-cell-in-a-worksheet/)**
- **[Excel Shortcuts: Delete to the End of Line in the Spreadsheet!!](https://geekexcel.com/shortcuts-for-delete-to-the-end-of-line-in-ms-excel-365/)**
- **[Formulas for Counting Cells that End with certain character or text!!](https://geekexcel.com/excel-formulas-for-counting-cells-that-end-with-certain-character-or-text/)**