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
Where's the TextBox?
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
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 02:52 PM.
Alan
Click the * below to say thanks.
Database Principles
Pivot Table Tips
Good Excel Video Tutorials
Sumifs or SumProduct
DataPig Access Tutorials
MS Query Tutorial
Worst Pie Chart Ever?
presumably a UserForm. this code is for a button on the userform.
Option Explicit Private Sub CommandButton1_Click() Dim vText As Variant Dim NextRw As Long vText = Split(Me.TextBox1.Value, " ") With Sheet1 NextRw = .Cells(.Rows.Count, 1).End(xlUp).Row + 1 .Cells(NextRw, 1).Value = vText(0) .Cells(NextRw, 2).Value = vText(1) End With End Sub
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
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.
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
Alan
Click the * below to say thanks.
Database Principles
Pivot Table Tips
Good Excel Video Tutorials
Sumifs or SumProduct
DataPig Access Tutorials
MS Query Tutorial
Worst Pie Chart Ever?
Access has the Split Function as well as Excel.
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel Tips & Solutions, free examples and tutorials why not check out my downloads
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
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.
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
Alan
Click the * below to say thanks.
Database Principles
Pivot Table Tips
Good Excel Video Tutorials
Sumifs or SumProduct
DataPig Access Tutorials
MS Query Tutorial
Worst Pie Chart Ever?
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.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks