Usually, the column separator in Excel is the Tab character (ASCII: Chr(9))
Try this:
Code:
Option Compare Database
Option Explicit
Private Sub cmd_save2_Click()
Const DATAOBJECT_BINDING As String = "new:{1C3B4210-F441-11CE-B9EA-00AA006B1A69}"
Dim Inhalt As Variant '<<<-- cannot be a string type
Dim z As Variant '<<-- array
Dim x As Long ' <<-- array upper bound
Dim i As Long ' <<-- counter
Dim sSQL As String
With CreateObject(DATAOBJECT_BINDING)
.GetFromClipboard
Inhalt = .GetText
Debug.Print Inhalt '<<-- to see the data in Inhalt - comment out later
End With
'fill the array
z = Split(Inhalt, Chr(9))
x = UBound(z)
'===============================================
'comment out later
'show the results
For i = 0 To x
Debug.Print ("The value of array in " & i & " is :" & z(i))
Next
'===============================================
' This is AIR CODE!!!
'Create the SQL string
sSQL = "INSERT INTO YourTableName (FieldName1, FieldName2, FieldName3,....)"
sSQL = sSQL & " VALUES (" & z(0) & ", " & z(1) & ", " ............ & ")" '<<-- Use proper delimiters for the data
CurrentDb.Execute sSQL, dbFailOnError
MsgBox "Done!"
End Sub
If Inhalt is declared as a string, the tab character is converted to one of more spaces.
So if this is what you are looking for, the next step is to comment out/delete the For.....Next loop and write code to create the "INSERT INTO" SQL code to add the data to the table.