![]() |
|
#1
|
|||
|
|||
|
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
|
|
|
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 |