LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #5   Report Post  
Posted to microsoft.public.excel.programming
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





 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract numbers from a code Mark Excel Worksheet Functions 3 June 9th 09 04:31 PM
can i link a variable cost code with a variable sum I need help!! Excel Discussion (Misc queries) 0 August 1st 08 11:40 AM
Extract a number from a variable text string tipsy Excel Discussion (Misc queries) 4 May 4th 08 03:28 AM
Code Post: Extract Trendline coefficients who Excel Discussion (Misc queries) 2 January 10th 05 11:36 PM
Extract a cells format and apply to a variable MikeR[_2_] Excel Programming 7 October 22nd 03 01:39 PM


All times are GMT +1. The time now is 01:34 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"