Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Fill Textbox from cell

Hi,
I need to fill two textboxes on a userform with information from one cell.
In Range ("ClientName") is text "Last, FirstName". I need to fill Textbox1
with "LastName" and Textbox2 with the "FirstName". I have no problem
filling the textbox with the entire text from the cell, but I have no idea
how to split the information at the comma. The only information I could
find suggested using the Left function, but since the number of characters
can vary that didn't work too well. Any help would be greatly appreciated.
Thanks
Valerie


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11
Default Fill Textbox from cell

Valerie

Try this: for last name =LEFT(ClientName,FIND(", ",ClientName)-1)
and for first name =RIGHT(ClientName,FIND(",",ClientName)-2)
That is dependant on names being separated by comma then space, if no comma
then in the formulas instead of comma between inverted commas, use a space
and perhaps alter the numbers to suit

Regards
Philip


"V. Roe" wrote in message
...
Hi,
I need to fill two textboxes on a userform with information from one cell.
In Range ("ClientName") is text "Last, FirstName". I need to fill
Textbox1
with "LastName" and Textbox2 with the "FirstName". I have no problem
filling the textbox with the entire text from the cell, but I have no idea
how to split the information at the comma. The only information I could
find suggested using the Left function, but since the number of characters
can vary that didn't work too well. Any help would be greatly
appreciated.
Thanks
Valerie




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 222
Default Fill Textbox from cell

Left(ClientName, WorksheetFunction.Find(",", ClientName) - 1) and
Right(ClientName, Len(ClientName) - WorksheetFunction.Find(",", ClientName)
- 1)


"V. Roe" wrote:

Hi,
I need to fill two textboxes on a userform with information from one cell.
In Range ("ClientName") is text "Last, FirstName". I need to fill Textbox1
with "LastName" and Textbox2 with the "FirstName". I have no problem
filling the textbox with the entire text from the cell, but I have no idea
how to split the information at the comma. The only information I could
find suggested using the Left function, but since the number of characters
can vary that didn't work too well. Any help would be greatly appreciated.
Thanks
Valerie



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Fill Textbox from cell

Thanks to both of you this worked great.

"bigwheel" wrote in message
...
Left(ClientName, WorksheetFunction.Find(",", ClientName) - 1) and
Right(ClientName, Len(ClientName) - WorksheetFunction.Find(",",

ClientName)
- 1)


"V. Roe" wrote:

Hi,
I need to fill two textboxes on a userform with information from one

cell.
In Range ("ClientName") is text "Last, FirstName". I need to fill

Textbox1
with "LastName" and Textbox2 with the "FirstName". I have no problem
filling the textbox with the entire text from the cell, but I have no

idea
how to split the information at the comma. The only information I could
find suggested using the Left function, but since the number of

characters
can vary that didn't work too well. Any help would be greatly

appreciated.
Thanks
Valerie





Reply
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
remove fill in text from a cell from an unpopulated fill-in cell Deb[_3_] Excel Worksheet Functions 1 September 22nd 09 03:28 PM
using a map to fill in a textbox Gideon New Users to Excel 4 May 13th 08 04:15 AM
HELP! I Lost The Ability To Advance From TextBox To TextBox With the ENTER Or The TAB Keys Minitman[_4_] Excel Programming 0 February 22nd 05 08:50 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:47 PM
Textbox Bug? Missing/delayed update of textbox filled via VBA MarcM Excel Programming 0 November 4th 04 05:43 PM


All times are GMT +1. The time now is 07:40 PM.

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

About Us

"It's about Microsoft Excel"