You're working with Excel in VBA is you're trying to convert the column number to letters but you don't know how to go on? Don't worry, keep reading and I'll explain how to do it.
The operation is very simple, all you have to do is call the function indicated below: ConvertToLetter passing as a parameter the number of the column you already know.
If you don't know where to start, go on Development in Excel (in the top menu) and click on Record Macro and in the small window that appears click on OK.
Immediately after click on the top Stop Recording and press the icon VISUAL BASIC.
In the window that opens, on the left click on Module 1 and add in the right window inside Sub Macro1 () the code to call the ConverToLetter function (in practice copy the code below).
Coltesto = ConvertToLetter (NumCol) 'NumCol is the number of the column you are passing through.
Add immediately after this command:
Msgbox Coltesto 'you will need it to see the column letter
After End Sub di Macro1() copy and paste the function below:
Function ConvertToLetter(byval iCol As Integer) As String
Dim iAlpha As Integer
Dim iRemainder As Integer
iAlpha = Int(iCol / 27)
iRemainder = iCol – (iAlpha * 26)
If iAlpha > 0 Then
ConvertToLetter = Chr(iAlpha + 64)
If iRemainder > 0 Then
ConvertToLetter = ConvertToLetter & Chr(iRemainder + 64)
You will need it to convert the column number to letters.
We are a specialized and passionate team of virtual reality. We have extensive experience in this area. We decided to create ForVirtualRealityLovers to share all our information with customers and users. We have quality information. You can find tips, guides, interviews, top products and much more! If you are curious, enter our site ForVirtualRealityLovers.com and discover the virtual world! 😉
Excel: how to solve the message "Privacy warning: this document contains macros, ActiveX controls .." ❯
Articles related to
How to apply Pagination in ASP
Best gaming mouse 2021: which one to buy
How to color alternate rows in Excel
How to configure XDebug on Netbeans with Wamp and Xampp
How to reduce the size and weight of an image
Add Comment from Excel VBA: How to Convert Column Number to Letters
❤️Chi Sleep For Virtual Reality Lovers?
For Virtual Reality Lovers we are a team of people who aim to give you all the best information about Virtual Reality.
What information do we share?
We share everything you need to know about virtual reality, tips, prices, features, guides and much more !.
🤖What are the best virtual reality products?
We have the best information section on the best virtual reality products.
This work is under a Creative Commons Attribution-Non-Commercial-No Derivatives 4.0 International License. 2021/primerpaso.me X
Check out our best articles!
Programs to delete undeletable files
How to compare two text files
Programs to delete unnecessary files
How to download and clone an entire website