How To Return Column Letter for column number In Microsoft Excel?
Tags: toreturncolumnletter, vbamacros
Published: 2021-10-21 02:18:37

---
title: How To Return Column Letter for column number In Microsoft Excel?
published: true
date: 2021-10-20 10:05:42 UTC
tags: ToReturnColumnLetter,VBAMacros
canonical_url: https://geekexcel.com/how-to-return-column-letter-for-column-number-in-microsoft-excel/
---

In this tutorial, we will guide you on how to  **return column letters for column numbers using VBA ** in Microsoft Excel. 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, 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://eadn-wc04-371788.nxedge.io/cdn/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.

```

Public Function ColLetter(colNumber As Long) As String
If colNumber < 27 Then
If colNumber = 0 Then
ColLetter = "Z"
Else
ColLetter = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ", colNumber, 1)
End If
Else
If colNumber < 26 ^ 2 + 27 Then
ColLetter = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ", FLOOR(colNumber / 26), 1)
ColLetter = ColLetter & ColLetter(colNumber Mod 26)
Else
ColLetter = Mid("ABCDEFGHIJKLMNOPQRSTUVWXYZ", FLOOR((colNumber - 26) / 676), 1)
ColLetter = ColLetter & ColLetter(colNumber - FLOOR((colNumber - 26) / 676) * 676)
End If
End If
End Function

```

- After that, you need to  **save the code**  by selecting it and then  **close the window**.

![](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/10/Save-the-Code-65-1024x492.png)<figcaption>Save the Code</figcaption>

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

![Choose Macro option](https://eadn-wc04-371788.nxedge.io/cdn/wp-content/uploads/2021/09/Choose-Macro-option-11-1024x184.png)<figcaption>Choose Macro option</figcaption>

- Finally, after running the macro, you will get  **return column letters for column numbers** in Excel.

## Closure

We hope that this tutorial gives you guidelines on how to  **return column letters for column numbers**  **using VBA**  in Microsoft Excel. 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/) **!!**

**Further Reference:**

- **[Excel Formulas to Find If the Cell is Not Blank ~ Simple Tutorial!!](https://geekexcel.com/excel-formulas-to-find-if-the-cell-is-not-blank/)**
- **[Excel Formulas to Highlight the Rows with Blank Cells ~ Easy Tricks!!](https://geekexcel.com/excel-formulas-highlight-rows-with-blank-cells/)**
- **[Formulas to Apply Conditional Formatting For If Column is Blank!!](https://geekexcel.com/excel-formulas-to-apply-conditional-formatting-for-if-column-is-blank/)**
- **[Excel Formulas to Highlight the Blank Cells with Conditional Formatting!!](https://geekexcel.com/excel-formulas-to-highlight-the-blank-cells-with-conditional-formatting/)**
- **[Excel Formulas to Test All Cells in Range are Blank ~ Easy Guide!!](https://geekexcel.com/excel-formulas-test-all-cells-in-a-range-are-blank/)**