This version is a bit shorter:Function Number2Char(ByVal vNumber)…

Comment posted Convert Excel Column Number into Column Name by Stan Scott.

This version is a bit shorter:

Function Number2Char(ByVal vNumber)

    Dim addr As String
    If vNumber  256 Then Exit Function

    addr = Range("A1").Offset(0, vNumber - 1).Address
    Number2Char = Replace(Replace(addr, "$", ""), Range(addr).Row, "")

End Function

Related Entries

  • Remove Non-AlphaNumeric Characters from String

    The function below will allow us to remove a non alphanumeric character from an input string. Be careful though, lengther the string, more time needed to evaluate each string on the sentence. To bad that I don’t have any idea on how to use Regular Expression in Excel VBA, if we can use regex to replace...

  • Auto Expanding VLOOKUP Table Array

    Ok, this time I want to talk about how to create a vlookup table array that automatically expanding in accordance with the numbers of available data. As we know, the basic form of Excel VLOOKUP to look for A1 value in range B1:C15 column no 2 is like this: =VLOOKUP(A1,B1:C15,2) With parameters such as the value we looking...

  • Number of Cells/Rows/Columns With Formula

    A few weeks ago I received this question from someone called LS: Hi I want to write a macro that counts the following - Number of cells with formula - Number of Rows with formula - Number of Columns with formula Please let me know if there is a way of doing it in Excel VBA To find out the number of...

  • Get Position of Last Column Containing Data with Excel VBA

    If you read my latest update on how we can get position of last row containing data, then most probably you already have a glimpse on how we perform the same task with last column containing data in Excel. The VBA code is the exact replica of the code to get the last row, only...

  • Excel Extract Cell Comments

    Excel VBA/Macro example below will extract comment from every cells with comment, and put the summary in the cell selected by user using Excel input box (read more about how to get cell reference using input box here). Sub CreateCommentsSummary()Dim rgComments As Range, rgCell As Range, rgOutput As Range, iRow As Integer,...

Valuable Resources

If you found this page useful, please consider bookmark it using social media or add a link to this page.

  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • connotea
  • Diigo
  • email
  • Fark
  • Identi.ca
  • Live
  • MisterWong
  • MySpace
  • Netvibes
  • NewsVine
  • PDF
  • Ping.fm
  • Propeller
  • Reddit
  • Simpy
  • StumbleUpon
  • Technorati
  • Twitter
  • Wikio
  • Yahoo! Bookmarks