View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming,microsoft.public.vb.general.discussion
jack jack is offline
external usenet poster
 
Posts: 97
Default Excel columns: Converting numbers to letters and vice versa

Thank you.
That will work only, when my app is connected to Excel.
I need more general solution.
Jack

"Leith Ross" wrote in message
...
On Mar 23, 12:49 pm, "Jack" <replyto@it wrote:
I need to convert column index (shown as letters) to the number.
For example:
Column: ABCD
What is the corresponding number of that column?
Jack

"Jarek Kujawa" wrote in message

...
am not sure what you mean exactly but one way might be:

k = ActiveCell.Column

On 23 Mar, 21:07, "Jack" <replyto@it wrote:

Hello,
My app is using Excel spreadsheet.
User has a choice of preselecting some of the sheet's columns.
Now:
Excel is using letters as the visual indexing, of the columns but when
programming the corresponding number (A --1, B --2..., AA--28,
AB--29
etc) must be used..


What will be the best method of converting those letters into numbers?
Jack


Hello Jack,

Use the Cells method to create a Range address and return only the
column number.

For example:
C = Cells(1, "ABCD").Column

Sincerely,
Leith Ross