I'm living in VBForum bcz its members deserve respect and appreciation
Posts
333
Split data help
Hi, Usually i used to transfer data from Excell multible column to access db. Now i have data in one column seperated by , as mention below. Please what should i change in code below to transfer data from excel to access db? or please advice me how to do it? i appreciate your help in advance.
Excel sheet data:
In column A,
Here is AN approach...I put your excel field into a textbox for clarification. Instead of putting the individual values as I did into an array of textboxes, insert them into your database instead.
Code:
Dim mySplitArray() As String
Dim myText As String
myText = Text1.Text & "," 'use your excel cell value instead of my text1.text (add a comma at the end)
mySplitArray = Split(myText, ",") 'splits your value
Dim i As Integer
For i = 0 To UBound(mySplitArray()) - 1
Text2(i).Text = mySplitArray(i) 'instead of putting the array into textboxes, do your insert cmd here
Next i
I'm living in VBForum bcz its members deserve respect and appreciation
Posts
333
Re: Split data help
Dear Sam, Thank you for your reply, i really enjoy apply your code i did make array and work such fine. I did not figure out how to add it to my project. I attach the source code with excel data and Access DB, I would be appreciate if you can look at it and help me. ofcource if you have time for me bro. Also, Thank you gep. Thank you again