Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a method or function
I need to pass in either a letter or a number and
retreive a letter or number, Example A=1, B=2, C=3, D=4 Or 1=A,2=B,3=C,4=D Thanks |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a method or function
with two textboxes and a command button on a userform,
add this code... Private Sub btnProcess_Click() Dim letter As String Dim value As Variant If Trim(TextBox1.Text) = "" Then Exit Sub If IsNumeric(TextBox1) Then value = Chr(CLng(TextBox1.Text) + 64) Else value = Asc(TextBox1.Text) - 64 End If TextBox2.value = value End Sub enter a letter or a number in textbox1, click the button and see what appears in textbox2.. A .... 1 Z ... 26 17 ... Q Patrick Molloy Microsoft Excel MVP -----Original Message----- I need to pass in either a letter or a number and retreive a letter or number, Example A=1, B=2, C=3, D=4 Or 1=A,2=B,3=C,4=D Thanks . |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Need a method or function
Hi,
Function LT(ByVal V As Variant) As Variant V = Trim(V) If IsNumeric(V) Then If V = 1 And V <= 26 Then LT = Chr(V + 64) Else LT = "" End If ElseIf V Like "[A-Z]" Or V Like "[a-z]" Then LT = Asc(UCase(V)) - 64 Else LT = "" End If End Function -- Regards, Soo Cheon Jheong _ _ ^ąŻ^ -- |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Forecast function calculation method? | New Users to Excel | |||
method and function | Excel Worksheet Functions | |||
Function or method | Excel Programming | |||
Calling a module function from a class method | Excel Programming | |||
Method? Function? Operator? I dunno ): | Excel Programming |