Hi all
I am looking to connect to a server and send data from a sheet within Excel.
The range I am looking to send is from "B15:AO64" but only if there is data by checking rows upwards.
This is the sample code I have been provided.
Dim con As Object
Set con = CreateObject("ADODB.Connection")
sConnString = "Provider=SQLOLEDB;Data Source=LLNMS19648\UMGBVSQL01;" & _
"Initial Catalog=four_form;" & _
"Integrated Security=XXXX;"
con.ConnectionString = sConnString
sSQL = "INSERT INTO VBA_SAMPLE (COL1,COL2) VALUES(" + CStr(Range("B2").Value2) + "," + CStr(Range("C2").Value2) + ")"
con.Open
con.Execute sSQL
Could you please help by filling in the blanks?
Thanks
Bookmarks