View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Extract last name into a variable using VBA code

Sub foo()
Dim LastName As String
Dim Temp

Temp = Split(ActiveCell)

LastName = Temp(UBound(Temp))
FirstName = Temp(LBound(Temp))

Debug.Print LastName, FirstName

End Sub

--
Regards,
Tom Ogilvy


"mikeburg" wrote in
message ...

Wonderful!

How would you extract the first name using the simplest VBA code?

Thanks, mikeburg


--
mikeburg
------------------------------------------------------------------------
mikeburg's Profile:

http://www.excelforum.com/member.php...o&userid=24581
View this thread: http://www.excelforum.com/showthread...hreadid=503728