i need some help in a type

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....
 
D

Don Guillett

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
 
S

Shane Devenshire

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top