Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
Numbers For Letters
Hi
Could someone show me the codes for the following problem? I want a Macro that should do the following? If cells(1,1)="abc" then I want cells(1,2) to show 123 If cells(1,1)="bac" then I want cells(1,2) to show 213 If cells(1,1)="cba" then I want cells(1,2) to show 321 Thanks. M Varnendra |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
Numbers For Letters
Hi,
Several ways and here's one Sub lime() Select Case Cells(1, 1).Value Case Is = "abc" Cells(1, 2) = 123 Case Is = "bac" Cells(1, 2) = 213 Case Is = "cba" Cells(1, 2) = 321 Case Else End Select End Sub Mike "Varne" wrote: Hi Could someone show me the codes for the following problem? I want a Macro that should do the following? If cells(1,1)="abc" then I want cells(1,2) to show 123 If cells(1,1)="bac" then I want cells(1,2) to show 213 If cells(1,1)="cba" then I want cells(1,2) to show 321 Thanks. M Varnendra |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
Numbers For Letters
Hi Mike
Sorry if my information is misleading but I need the codes to generate numbers to cover every permutation generated via the key board. Actually I gave the 'abc' as an example. If somebody puts in 'Tim' in cells(1,1) then the number generated should be 20913 meaning 20 for t, 9 for i and 13 for m. Do you have a solution? Thanks M Varnendra "Mike H" wrote: Hi, Several ways and here's one Sub lime() Select Case Cells(1, 1).Value Case Is = "abc" Cells(1, 2) = 123 Case Is = "bac" Cells(1, 2) = 213 Case Is = "cba" Cells(1, 2) = 321 Case Else End Select End Sub Mike "Varne" wrote: Hi Could someone show me the codes for the following problem? I want a Macro that should do the following? If cells(1,1)="abc" then I want cells(1,2) to show 123 If cells(1,1)="bac" then I want cells(1,2) to show 213 If cells(1,1)="cba" then I want cells(1,2) to show 321 Thanks. M Varnendra |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
Numbers For Letters
Thank You.
M Varnendra "Sandy Mann" wrote: Try something like: Sub NumberIt() Dim CellLength As Integer Dim Counter As Integer Dim Numbers As String Dim CheckIt As String CheckIt = UCase(Cells(1, 1).Value) CellLength = Len(CheckIt) For Counter = 1 To CellLength Numbers = Numbers & Asc(Mid(CheckIt, Counter, 1)) - 64 Next Counter Cells(1, 2).Value = Numbers End Sub -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Varne" wrote in message ... Hi Mike Sorry if my information is misleading but I need the codes to generate numbers to cover every permutation generated via the key board. Actually I gave the 'abc' as an example. If somebody puts in 'Tim' in cells(1,1) then the number generated should be 20913 meaning 20 for t, 9 for i and 13 for m. Do you have a solution? Thanks M Varnendra "Mike H" wrote: Hi, Several ways and here's one Sub lime() Select Case Cells(1, 1).Value Case Is = "abc" Cells(1, 2) = 123 Case Is = "bac" Cells(1, 2) = 213 Case Is = "cba" Cells(1, 2) = 321 Case Else End Select End Sub Mike "Varne" wrote: Hi Could someone show me the codes for the following problem? I want a Macro that should do the following? If cells(1,1)="abc" then I want cells(1,2) to show 123 If cells(1,1)="bac" then I want cells(1,2) to show 213 If cells(1,1)="cba" then I want cells(1,2) to show 321 Thanks. M Varnendra |
#6
Posted to microsoft.public.excel.misc
|
|||
|
|||
Numbers For Letters
Youbare very welcome.
-- Regards, Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Varne" wrote in message ... Thank You. M Varnendra "Sandy Mann" wrote: Try something like: Sub NumberIt() Dim CellLength As Integer Dim Counter As Integer Dim Numbers As String Dim CheckIt As String CheckIt = UCase(Cells(1, 1).Value) CellLength = Len(CheckIt) For Counter = 1 To CellLength Numbers = Numbers & Asc(Mid(CheckIt, Counter, 1)) - 64 Next Counter Cells(1, 2).Value = Numbers End Sub -- HTH Sandy In Perth, the ancient capital of Scotland and the crowning place of kings Replace @mailinator.com with @tiscali.co.uk "Varne" wrote in message ... Hi Mike Sorry if my information is misleading but I need the codes to generate numbers to cover every permutation generated via the key board. Actually I gave the 'abc' as an example. If somebody puts in 'Tim' in cells(1,1) then the number generated should be 20913 meaning 20 for t, 9 for i and 13 for m. Do you have a solution? Thanks M Varnendra "Mike H" wrote: Hi, Several ways and here's one Sub lime() Select Case Cells(1, 1).Value Case Is = "abc" Cells(1, 2) = 123 Case Is = "bac" Cells(1, 2) = 213 Case Is = "cba" Cells(1, 2) = 321 Case Else End Select End Sub Mike "Varne" wrote: Hi Could someone show me the codes for the following problem? I want a Macro that should do the following? If cells(1,1)="abc" then I want cells(1,2) to show 123 If cells(1,1)="bac" then I want cells(1,2) to show 213 If cells(1,1)="cba" then I want cells(1,2) to show 321 Thanks. M Varnendra |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
letters for numbers | Excel Discussion (Misc queries) | |||
Sorting - cells containing numbers, numbers and letters | Excel Discussion (Misc queries) | |||
create self-generating numbers with letters and numbers | Excel Discussion (Misc queries) | |||
Letters = Numbers | Charts and Charting in Excel | |||
corresponding numbers and letters | Excel Discussion (Misc queries) |