+ Reply to Thread
Results 1 to 4 of 4

how do i turn column letters to numbers and vice versa

Hybrid View

  1. #1
    Forum Contributor
    Join Date
    06-29-2011
    Location
    Scotland
    MS-Off Ver
    Excel 2003
    Posts
    122

    how do i turn column letters to numbers and vice versa

    how do i turn column letters to numbers and vice versa

    ------------------

    take y values from column and take x values from row

    I have 'resolved' values in column A1:A10
    I have 'received' values in row B11:K11

    I need to fill out a table using the tables axis values stored in the column and row above.

    Such as:

     For i = 1 to 10 Step 1
      Resolved = Range("A" & i).Value
     For j = B to K Step 1
      Received = Range(j & 11).Value
    
     Range(j & i).Value = 2*(Resolved+Received)/3
    
     Next j
     Next i

  2. #2
    Valued Forum Contributor
    Join Date
    03-29-2013
    Location
    United Kingdom
    MS-Off Ver
    Office/Excel 2013
    Posts
    1,749

    Re: how do i turn column letters to numbers and vice versa

    Public Function ColumnLetter(AnyCell As Range) As String
      ColumnLetter = Left(AnyCell.Address(False, False), 1 - CInt(AnyCell.Column > 26))
    End Function
    
    Dim Col as string
    Col = ColumnLetter(Cells(Y, X))	'Called from a sub
    That will convert column number to a letter
    Elegant Simplicity............. Not Always

  3. #3
    Forum Expert romperstomper's Avatar
    Join Date
    08-13-2008
    Location
    England
    MS-Off Ver
    365, varying versions/builds
    Posts
    22,015

    Re: how do i turn column letters to numbers and vice versa

    No need to - use Cells which will accept either a letter or number for the column:
    For j = 2 to 11 Step 1
      Received = Cells(11, j).Value
    Everyone who confuses correlation and causation ends up dead.

  4. #4
    Valued Forum Contributor
    Join Date
    03-21-2013
    Location
    cyberia
    MS-Off Ver
    Excel 2007
    Posts
    457

    Re: how do i turn column letters to numbers and vice versa

    literal answer to the title of your thread

    Letter to number
    Lettr = "EQ"
    Nmbr = Columns(Lettr).Column
    MsgBox Nmbr
    Number to letter
    Nmbr = 218
    Lettr = Split(Columns(Nmbr).Address, "$")(2)
    MsgBox Lettr

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 4
    Last Post: 03-31-2010, 09:54 PM
  2. [SOLVED] convert negative numbers to positive numbers and vice versa
    By bill gras in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 12-06-2005, 09:45 PM
  3. [SOLVED] turn a column into a row or visa versa
    By Joshua Veit in forum Excel General
    Replies: 2
    Last Post: 06-27-2005, 04:05 PM
  4. [SOLVED] How do I change rows content to column & vice versa Excel spread s
    By Harinath in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 05-13-2005, 06:06 PM
  5. [SOLVED] how to format numbers stored as text or vice versa to use vlookup
    By teneagle in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 02-03-2005, 07:06 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1