iam finding the last name and first but i need to see first letter firstname should be upper case and last name first letter should be upper case
for example
hari sunder it should give the result of Hari Sunder
HTML Code:Sub macro1() Dim firstName As String Dim lastName As String Dim n As Integer Dim rowNum As Integer Dim colNum As Integer rowNum = 1 colNum = 1 While Cells(rowNum, colNum).Value <> "" n = InStr(1, Cells(rowNum, colNum).Value, ",") lastName = Left(Cells(rowNum, colNum).Value, n - 1) firstName = Right(Cells(rowNum, colNum).Value, Len(Cells(rowNum, colNum).Value) - n - 1) Cells(rowNum, colNum + 1).Value = firstName Cells(rowNum, colNum + 2).Value = lastName rowNum = rowNum + 1 Wend End Sub




Reply With Quote