+ Reply to Thread
Results 1 to 11 of 11

Multiple words in textbox to different columns

  1. #1
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Multiple words in textbox to different columns

    Hi,

    I have a textbox in which I'll need to insert a link and a username spearted by a single space.
    For instance:

    excelforum.com Alexander Ceed

    I need everything up to the first space placed in a column and everything else from the first space placed in a different column but all on the same table.

    For example:
    excelforum.com in TEST1
    Alexander Ceed in TEST2

    Please help. Thank you

  2. #2
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multiple words in textbox to different columns

    Where's the TextBox?
    Hope that helps.

    RoyUK
    --------
    For Excel Tips & Solutions, free examples and tutorials why not check out my web site

    Free DataBaseForm example

  3. #3
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Re: Multiple words in textbox to different columns

    Quote Originally Posted by royUK View Post
    Where's the TextBox?
    Don't know if this the right answer.. It's in a form

  4. #4
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Multiple words in textbox to different columns

    Alexander;
    Let me make sure I understand your needs. You have a textbox on a form with an entry that looks like "excelforum.com Alexander Ceed". You wish for the data to be stored in a table in two different fields. In field one you would have excelforum.com and in field two, Alexander Ceed.

    Is this something that you wish to do one time or it will be done on a continuous basis? Is the information in the text box, coming from manual data entry or is it being imported from another source?

    Last question: Excel spreadsheet or Access Form?

    Alan
    Last edited by alansidman; 12-18-2010 at 03:52 PM.
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  5. #5
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multiple words in textbox to different columns

    presumably a UserForm. this code is for a button on the userform.
    Please Login or Register  to view this content.

  6. #6
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Re: Multiple words in textbox to different columns

    royUK,
    I'm no expert here but that's an excel code if I'm not mistaken. The form is in an access database.

    Alan,
    That's exactly what I need. It will be on a continuous basis and the data is entered manually.

    Thanks for looking into it guys. I appreciate your efforts.

  7. #7
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Multiple words in textbox to different columns

    Alexander,
    If the data is being entered manually, then why don't you create two text boxes that are bound to two fields in your table and enter the appropriate data in each text box? I am confused as to why you would enter all the data into one text box only to split it into two fields.

    Alan

  8. #8
    Forum Expert royUK's Avatar
    Join Date
    11-18-2003
    Location
    Derbyshire,UK
    MS-Off Ver
    Xp; 2007; 2010
    Posts
    26,200

    Re: Multiple words in textbox to different columns

    Access has the Split Function as well as Excel.

  9. #9
    Forum Contributor
    Join Date
    07-16-2009
    Location
    NA
    MS-Off Ver
    MS Excel 2010
    Posts
    237

    Re: Multiple words in textbox to different columns

    Alan,
    The reason is the clutter. I already have a lot of textboxes and I was thinking to cut-down on some of them by interting multiple data in a single textbox.

  10. #10
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,882

    Re: Multiple words in textbox to different columns

    I would urge you to reconsider and not short cut yourself when it comes to fields and controls. If you have them bound and don't need any manipulation the chances of something going awry is mitigated. It helps to keep it simple for users. With multiple entries in a control, what is to prevent the user from entering to many spaces, or not enough spaces to separate properly. Punctuation that is not necessary, or improper capitalization. I personally would go for the extra text boxes. Perhaps set up your form with tabs or pages so it doesn't look so cluttered. If you consider tabs, here is a video that will help.

    http://www.datapigtechnologies.com/f...abcontrol.html

    Alan

  11. #11
    Registered User
    Join Date
    01-02-2011
    Location
    Manchester
    MS-Off Ver
    Excel 2010
    Posts
    31

    Re: Multiple words in textbox to different columns

    I have to agree you should use separate text boxes at all times for such types of data capture - an alternative to tabs would be to create a pop-form this would overlay your current open form and provides space for additional data capture.

+ 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