Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 186
Default how can i ask the program to convert numbers to text automaticaly

how can i ask the program to convert numbers to text automatically?
I want to input a number into a cell and have the program automatically
convert the number into a letter.
For example 1=a 2=b etc.
is there an fuction that can do that?
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default how can i ask the program to convert numbers to text automaticaly

This is example code and can be changed to suit. It assumes that the range is
in column A starting at A2. Paste the code to the worksheet's code module. To
access the code module, right click the worksheet tab and select View Code.
Numbers between 1 and 26 entered into any cell in column A except A1 will be
converted to lower case letters.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
If Target.Count 1 Then Exit Sub
Set r = Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))
If Not Intersect(Target, r) Is Nothing Then
With Application
.EnableEvents = False
If IsNumeric(Target) Then
Target.Value = Chr(Target.Value + 96)
End If
.EnableEvents = True
End With
End If
End Sub

Regards,
Greg


"jack" wrote:

how can i ask the program to convert numbers to text automatically?
I want to input a number into a cell and have the program automatically
convert the number into a letter.
For example 1=a 2=b etc.
is there an fuction that can do that?

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 747
Default how can i ask the program to convert numbers to text automatic

To simplify, the End(xlUp) part can be eliminated. Suggest this:

Set r = Range(Cells(2, 1), Cells(Rows.Count, 1))

in place of this:

Set r = Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))

Greg

"Greg Wilson" wrote:

This is example code and can be changed to suit. It assumes that the range is
in column A starting at A2. Paste the code to the worksheet's code module. To
access the code module, right click the worksheet tab and select View Code.
Numbers between 1 and 26 entered into any cell in column A except A1 will be
converted to lower case letters.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
If Target.Count 1 Then Exit Sub
Set r = Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))
If Not Intersect(Target, r) Is Nothing Then
With Application
.EnableEvents = False
If IsNumeric(Target) Then
Target.Value = Chr(Target.Value + 96)
End If
.EnableEvents = True
End With
End If
End Sub

Regards,
Greg


"jack" wrote:

how can i ask the program to convert numbers to text automatically?
I want to input a number into a cell and have the program automatically
convert the number into a letter.
For example 1=a 2=b etc.
is there an fuction that can do that?

  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 186
Default how can i ask the program to convert numbers to text automatic

Thanks so much. I didn't think anyone would actually reply.

"Greg Wilson" wrote:

To simplify, the End(xlUp) part can be eliminated. Suggest this:

Set r = Range(Cells(2, 1), Cells(Rows.Count, 1))

in place of this:

Set r = Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))

Greg

"Greg Wilson" wrote:

This is example code and can be changed to suit. It assumes that the range is
in column A starting at A2. Paste the code to the worksheet's code module. To
access the code module, right click the worksheet tab and select View Code.
Numbers between 1 and 26 entered into any cell in column A except A1 will be
converted to lower case letters.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim r As Range
If Target.Count 1 Then Exit Sub
Set r = Range(Cells(2, 1), Cells(Rows.Count, 1).End(xlUp))
If Not Intersect(Target, r) Is Nothing Then
With Application
.EnableEvents = False
If IsNumeric(Target) Then
Target.Value = Chr(Target.Value + 96)
End If
.EnableEvents = True
End With
End If
End Sub

Regards,
Greg


"jack" wrote:

how can i ask the program to convert numbers to text automatically?
I want to input a number into a cell and have the program automatically
convert the number into a letter.
For example 1=a 2=b etc.
is there an fuction that can do that?

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 numbers stored as text to numbers Excel 2000 Darlene Excel Discussion (Misc queries) 6 January 31st 06 08:04 PM
How do you convert numbers to real text Harry Excel Discussion (Misc queries) 5 January 27th 06 02:21 AM
How can I convert Text into numbers? Greta Excel Worksheet Functions 8 August 22nd 05 02:03 PM
how do I convert copied Text numbers into values in Excel? MOE Excel Worksheet Functions 1 June 14th 05 06:03 AM
Convert text to numbers gennario Excel Discussion (Misc queries) 6 January 10th 05 11:56 PM


All times are GMT +1. The time now is 02:34 PM.

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

About Us

"It's about Microsoft Excel"