This code works for one sheet only. i need it to be expand to x amount of sheet same workbook..
recap this code works for one sheet only. i need it to be expandable to x amount of sheet..
VBA Code:
Set objConnection = CreateObject("ADODB.Connection")
Set objRecordset = CreateObject("ADODB.Recordset")
objConnection.Open "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & Sheet10.Range("B11").Value & ";Extended Properties=""Excel 12.0 Xml;HDR=Yes;IMEX=0"";"
objRecordset.Open "Select * FROM [Database$]", objConnection '<------XXXXXX$ tab name with in B11 location
Database.Range("A2").CopyFromRecordset objRecordset
objRecordset.Close
objConnection.Close
recap this code works for one sheet only. i need it to be expandable to x amount of sheet..