ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Worksheet Functions (https://www.excelbanter.com/excel-worksheet-functions/)
-   -   i need some help in a type (https://www.excelbanter.com/excel-worksheet-functions/235022-i-need-some-help-type.html)

Vatos

i need some help in a type
 
i have the first name o people in a row of names, and i want a type to check
if the second to last letter is "η" then write the name without the last
character , if the second to last letter is "ο" then write the name with the
last character changed to "υ" and if the last letter is different of the 2
above then leave the name as is....


Don Guillett

i need some help in a type
 
Sub checknexttolastchar()
For Each c In Selection
Select Case LCase(Left(Right(c, 2), 1))
Case Is = "n": lc = ""
Case Is = "o": lc = "u"
Case Else: lc = Right(c, 1)
End Select
c.value = Left(c, Len(c) - 1) & lc
Next
End Sub


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Vatos" wrote in message
...
i have the first name o people in a row of names, and i want a type to
check
if the second to last letter is "η" then write the name without the last
character , if the second to last letter is "ο" then write the name with
the
last character changed to "υ" and if the last letter is different of the 2
above then leave the name as is....



Shane Devenshire[_2_]

i need some help in a type
 
Hi,

here is a formula approach

=IF(LEFT(RIGHT(A9,2))="n",LEFT(A9,LEN(A9)-1),IF(LEFT(RIGHT(A9,2))="o",LEFT(A9,LEN(A9)-1)&"u",A9))

where the name is in A9.

--
If this helps, please click the Yes button.

Cheers,
Shane Devenshire


"Vatos" wrote:

i have the first name o people in a row of names, and i want a type to check
if the second to last letter is "η" then write the name without the last
character , if the second to last letter is "ο" then write the name with the
last character changed to "υ" and if the last letter is different of the 2
above then leave the name as is....



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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com