View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
tjtjjtjt tjtjjtjt is offline
external usenet poster
 
Posts: 51
Default Switch names in cell

I got a run time error (438: Object doesn't support this property of method)
on the line Application.Split.

I'll ultimately want to be able to identify the column of names within a
list of information and then switch the names.
The names are usually, but not always, in Column A, so the code will need to
look for one of two words, "Name" or "Instructor," and then switch the names
in every record.

--
tj


"Tom Ogilvy" wrote:

How robust does it need to be

Dim cell as Range, sStr as String
for each cell in Selection
v = Application.Split(cell,",")
sStr = Trim( trim(v(Ubound(v))) & " " & trim(v(Lbound(v))))
cell.Value = sStr
Next

--
Regards,
Tom Ogilvy

"tjtjjtjt" wrote in message
...
Does anyone have a routine that can take a list of names entered as
"Lastname, Firstname" and change those names to "Firstname Lastname"

within
the same cells?

Thanks,

--
tj