Originally Posted by ScotExcel
It's unbelievably possible. I'd need more details but I'll assume you've done nothing on it yet.
For this code to work you'll need to add a reference to "Microsoft ActiveX Data Objects [2.8] Library" (in VBA go to Tools > References, find it, tick it). 2.8 is in my reference list, if it's not in yours just use another one.
You'll have to figure out those XXXXXXXXXs yourself. I'm not sure if you're using sql server or mysql etc. Google "connection string" for whatever you're using (e.g. "sql server connection string"). Obviously you'll have to know your username and password as well.
I called the sheet "Data", you can change that to anything you want.
You can call that function from wherever, e.g. when the workbook opens.
More information on ADO, http://support.microsoft.com/kb/257819, http://msdn.microsoft.com/en-us/libr...2(SQL.80).aspx