+ Reply to Thread
Results 1 to 8 of 8

Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

  1. #1
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    The following code is being used to take data that is in a cell, and split it up so that when a user goes to edit the data using a multipage form the "First Name" and "Last Name" fields are populated.

    Please Login or Register  to view this content.

    I just ran into a situation where somebody had a middle initial listed... so in the Cell it was "Name Middle Last", and when the info was showing in the form it had "Name" in the first name field, and "Middle" in the last name field... because a Strname2 is not being captured - and even if it was the code does not know to put strname2 in the "lastname1" field.

    Question that I have is

    How would I go about recoding this so that

    if "n" is the number of strname() generated, then

    Firstname1 = strname(0), strname(1), strname(2)...... strname(n-1) (with spaces in between each name)
    Lastname1 = strname(n)

  2. #2
    Forum Expert Greg M's Avatar
    Join Date
    08-16-2007
    Location
    Dublin. Ireland
    MS-Off Ver
    Office 2016
    Posts
    4,481

    Re: Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    Hi there,

    Maybe something like:

    Please Login or Register  to view this content.

    Hope this helps - please let me know how you get on.

    Regards,

    Greg M

  3. #3
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    How about
    Please Login or Register  to view this content.

  4. #4
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Re: Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    Thank you! This worked perfectly.

  5. #5
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    How do you want the routine to handle "Jean Claude Van Damme" or "Ludwig Von Beethoven"
    _
    ...How to Cross-post politely...
    ..Wrap code by selecting the code and clicking the # or read this. Thank you.

  6. #6
    Spammer
    Join Date
    11-21-2014
    Location
    California
    MS-Off Ver
    2010
    Posts
    387

    Re: Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    Quote Originally Posted by mikerickson View Post
    How do you want the routine to handle "Jean Claude Van Damme" or "Ludwig Von Beethoven"
    I have been torn on that as well.

    Luckily the only time that this will be an issue is when somebody's info is being edited... and after the edit is done, it is going to put the full string back into the cell. So in the end, you have Jean Claude Van Damme, splits to Firstname1 = "Jean Claude Van" last name1 = "Damme"

    Edits are made in the userform, and when the "Update" button is pushed the cell will again ready "Jean Claude Van Damme" (unless one of the edits was to the name - like a typo or something?)

  7. #7
    Forum Expert mikerickson's Avatar
    Join Date
    03-30-2007
    Location
    Davis CA
    MS-Off Ver
    Excel 2011
    Posts
    6,229

    Re: Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    I would recommend that your worksheet store separate fields for First and Last name, rather than one FullName field.

  8. #8
    Forum Guru
    Join Date
    09-10-2017
    Location
    Chippenham, England
    MS-Off Ver
    365
    Posts
    15,080

    Re: Splitting Name from Cells to feed back into Multipage Form - More than 2 Strings

    Quote Originally Posted by snuffnchess View Post
    Thank you! This worked perfectly.
    You're welcome & thanks for the feedback

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Splitting a Population into Two Studies RRS feed
    By Darko_Giac in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-25-2019, 04:45 PM
  2. [SOLVED] ActiveControl - Return non-Multipage control when Form contains Multipage?
    By mc84excel in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 03-04-2014, 08:37 PM
  3. Splitting text strings into multiple cells
    By newbie762 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 12-06-2012, 05:44 AM
  4. optionbuttons on a form - feed back
    By impartrudie in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 10-18-2011, 02:23 AM
  5. Displaying range of cells in a Multipage/Tap form
    By AUmmar in forum Excel General
    Replies: 1
    Last Post: 02-09-2009, 06:43 AM
  6. Help With Basic Feed Back Loop
    By STAPLER2 in forum Excel General
    Replies: 2
    Last Post: 11-05-2008, 02:07 AM
  7. [SOLVED] Programming header/footer strings with line feed
    By XP in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 08-26-2005, 09:05 AM

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