+ Reply to Thread
Results 1 to 4 of 4

Fill Textbox from cell

  1. #1
    V. Roe
    Guest

    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. #2
    Philip Reece-Heal
    Guest

    Re: 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" <[email protected]> wrote in message
    news:[email protected]...
    > 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. #3
    bigwheel
    Guest

    RE: 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. #4
    V. Roe
    Guest

    Re: Fill Textbox from cell

    Thanks to both of you this worked great.

    "bigwheel" <[email protected]> wrote in message
    news:[email protected]...
    > 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 to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1