i need some help in a type

  • Thread starter Thread starter Vatos
  • Start date Start date
V

Vatos

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....
 
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
 
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.
 
Back
Top