Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 40
Default convert numbers to alpha code

I need to convert numbers to an alpha equivilant. ie if colum a is 123 I
would like colum b to convert that to abc.
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 903
Default convert numbers to alpha code

Seems useless enough to be homework, especially with all of the
misspellings. Here is an example that will convert what is in a cell
that is double-clicked to a value and place it into the cell to the
right, regardless of previous content.

Install by right clicking on the worksheet tab, choose "View Code"
and insert the following.

Option Explicit
Private Sub Worksheet_BeforeDoubleClick(ByVal Target _
As Range, Cancel As Boolean)
Cancel = True
Dim i As Double, str As String, txt As String
txt = Target.Value
Dim v As Integer
str = ""
For i = 1 To Len(txt)
If IsNumeric(Mid(txt, i, 1)) Then
v = Mid(txt, i, 1) + 1
str = str & Mid("jabcdefghi", v, 1)
Else
str = str & Mid(txt, i, 1)
End If
Next i
Target.Offset(0, 1) = str
End Sub



You can read more about macros on my pages.


--

---
HTH,
David McRitchie, Microsoft MVP - Excel
My Excel Pages: http://www.mvps.org/dmcritchie/excel/excel.htm
Search Page: http://www.mvps.org/dmcritchie/excel/search.htm

"chas" wrote in message ...
I need to convert numbers to an alpha equivilant. ie if colum a is 123 I
would like colum b to convert that to abc.



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Convert a julian gregorian date code into a regular date Robert Excel Worksheet Functions 3 June 13th 06 07:03 PM
Why are 1/2 my numbers imported as text and the rest as numbers? KBear Excel Discussion (Misc queries) 2 April 21st 06 01:40 PM
Change case...help please Terry Excel Worksheet Functions 14 October 2nd 05 12:29 PM
Convert text to numbers vipa2000 Excel Worksheet Functions 3 August 1st 05 09:01 PM
Make Change Case in Excel a format rather than formula Kevin Excel Worksheet Functions 1 March 18th 05 08:53 PM


All times are GMT +1. The time now is 06:49 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"