Hi Sharath,

PFA,

Hope it will help you.

Divaker


Private Sub Worksheet_Change(ByVal Target As Range)
 On Error GoTo Exit_Sub
    Dim nameIS() As String, newName As String
    If Target.Column = 6 And Target.Row > 6 Then
     If IsEmpty(Target.Value) Then Exit Sub
        If InStr(Target.Value, ",") = 0 Then
             nameIS = Split(Trim(Target.Value), " ")
             newName = nameIS(UBound(nameIS))
                If UBound(nameIS) > 0 Then
                     If Len(newName) > 0 Then newName = newName & ","
                              For i = 0 To UBound(nameIS) - 1
                                newName = newName & " " & nameIS(i)
                             Next
                    End If
                     Target.Value = newName
                End If

     End If
Exit_Sub:
End Sub



On Fri, Jun 29, 2012 at 5:11 PM, sharath chandra <
sharath.c.sambr...@gmail.com> wrote:

> Hello Experts,
>
> I have attached a spreadsheet. In Column F we have a name. By default it
> is validated in the format "First Name (and Middle Name if exists) Last
> Name".
>
> So when someone types in a name in any of the cell in Column F, it should
> convert the format to "Last Name, (comma) First (and Middle) Name".
>
> I hope I am able to explain it clearly.
>
> Thank you in advance,
>
> Sharath
>
> --
> FORUM RULES (986+ members already BANNED for violation)
>
> 1) Use concise, accurate thread titles. Poor thread titles, like Please
> Help, Urgent, Need Help, Formula Problem, Code Problem, and Need Advice
> will not get quick attention or may not be answered.
>
> 2) Don't post a question in the thread of another member.
>
> 3) Don't post questions regarding breaking or bypassing any security
> measure.
>
> 4) Acknowledge the responses you receive, good or bad.
>
> 5) Cross-promotion of, or links to, forums competitive to this forum in
> signatures are prohibited.
>
> NOTE : Don't ever post personal or confidential data in a workbook. Forum
> owners and members are not responsible for any loss.
>
>
> ------------------------------------------------------------------------------------------------------
> To post to this group, send email to excel-macros@googlegroups.com
>
> To unsubscribe, send a blank email to
> excel-macros+unsubscr...@googlegroups.com

-- 
FORUM RULES (986+ members already BANNED for violation)

1) Use concise, accurate thread titles. Poor thread titles, like Please Help, 
Urgent, Need Help, Formula Problem, Code Problem, and Need Advice will not get 
quick attention or may not be answered.

2) Don't post a question in the thread of another member.

3) Don't post questions regarding breaking or bypassing any security measure.

4) Acknowledge the responses you receive, good or bad.

5)  Cross-promotion of, or links to, forums competitive to this forum in 
signatures are prohibited. 

NOTE  : Don't ever post personal or confidential data in a workbook. Forum 
owners and members are not responsible for any loss.

------------------------------------------------------------------------------------------------------
To post to this group, send email to excel-macros@googlegroups.com

To unsubscribe, send a blank email to excel-macros+unsubscr...@googlegroups.com

Attachment: Copy of NeedVBA-Code.xlsm
Description: Binary data

Reply via email to