help needed in using userform textbox1 to populate other textbox with data delimiter entered in textbox1

Status
Not open for further replies.

Jcjepot

New Member
Joined
Oct 5, 2021
Messages
13
Office Version
  1. 365
Platform
  1. Windows
. I have managed to make a userform for data entry. but the same problem occurs. The data are separated by commas , which are entered as full details in textbox1. Would it be possible to automatically populate the other textboxes using the data in textbox1? or is it possible to use the data in the database to be separated in columns as we enter the infos? sorry for this, im trying really hard to comeup with a better solution. thank you
SAMPLE DATA :
HC12345678,AABABA ANANS ANSNUA,Male,DD/MM/YYYY,MOROCCAN,,*00000000000*

VBA Code:
Private Sub ComboBox1_Change()

End Sub

Private Sub CommandButton1_Click()
Set sh = ThisWorkbook.Sheets("Database")

Dim Last_Row As Long

Last_Row = Application.WorksheetFunction.CountA(sh.Range("A:A"))

sh.Range("A" & Last_Row + 1).Value = "=Row()-1"
sh.Range("B" & Last_Row + 1).Value = Me.TextBox1.Value
sh.Range("C" & Last_Row + 1).Value = Me.TextBox2.Value
sh.Range("D" & Last_Row + 1).Value = Me.TextBox3.Value
sh.Range("E" & Last_Row + 1).Value = Me.ComboBox1.Value
sh.Range("F" & Last_Row + 1).Value = Me.TextBox4.Value
sh.Range("G" & Last_Row + 1).Value = Me.TextBox5.Value
sh.Range("H" & Last_Row + 1).Value = Me.TextBox6.Value
sh.Range("J" & Last_Row + 1).Value = Me.ComboBox2.Value
sh.Range("K" & Last_Row + 1).Value = Now
sh.Range("L" & Last_Row + 1).Value = Me.TextBox7.Value
sh.Range("M" & Last_Row + 1).Value = Now


Me.TextBox1.Value = ""
Me.TextBox2.Value = ""
Me.TextBox3.Value = ""
Me.ComboBox1.Value = ""
Me.TextBox4.Value = ""
Me.TextBox5.Value = ""
Me.TextBox6.Value = ""
Me.ComboBox2.Value = ""
Me.TextBox7.Value = ""

Call Refresh_Data
End Sub

Private Sub CommandButton2_Click()
 

Excel Facts

Can Excel fill bagel flavors?
You can teach Excel a new custom list. Type the list in cells, File, Options, Advanced, Edit Custom Lists, Import, OK
Duplicate to: HELP: Im trying to figure out how to code a userform. basically , i want to populate textbox 2-8 with the data found in textbox1 with "," as the delim

In future, please do not post the same question multiple times. Per Forum Rules (#12), posts of a duplicate nature will be locked or deleted.

In relation to your question here, I have closed this thread so please continue in the linked thread. If you do not receive a response, you can "bump" it by replying to it yourself, though we advise you to wait 24 hours before doing so, and not to bump a thread more than once a day.
 
Upvote 0
Status
Not open for further replies.

Forum statistics

Threads
1,214,424
Messages
6,119,407
Members
448,894
Latest member
spenstar

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top