#1
|
|||
|
|||
vbc code
hi
this is the code i found out from the web how to make RAJ PETER SHOUld show Raj Peter 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 |
#2
|
||||
|
||||
Hi,
You probably don't need VBA for this. If RAJ PETER is in cell A1, then this formula will return Raj Peter =PROPER(A1) Is that something you can work with? |
#3
|
|||
|
|||
thanks but it is not only A1 IT has more than 1000 names and i have vb code find out last name and first name it works the above code. but i have the cell RAJ PETER Full upper case but i want the first letter should be upper case exampel Raj Peter
|
Thread Tools | |
Display Modes | |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Code to add dates | terricritch | Excel Programming | 10 | 11-08-2011 09:51 AM |
vba code in excel | rajpeter | Excel Programming | 5 | 09-11-2011 06:13 PM |
Fastest way to run a code | b0x4it | Word VBA | 4 | 05-18-2011 07:54 PM |
FileSaveAs with Code | bsmith | Office | 0 | 01-05-2006 08:43 AM |