Hi,
I have the following code which gets the query results from an Access database
the problem is that the data in that table is over 65,000 sheets. How can i perform the above and get the data inserted into multiple sheets?![]()
Sub GetUnbilleddata() Sheets("Sheet1").Select Set Cn = CreateObject("adodb.connection") Set Rs = CreateObject("adodb.recordset") Dim DatabasePath As String DatabasePath = Environ("USERPROFILE") & "\Desktop\SAPUnbilled.mdb" If Dir(DatabasePath) <> "" Then Cn.Open "provider=microsoft.jet.oledb.4.0;data source=" & DatabasePath Rs.Open "select * from vwSAP_UnbilledElecReport", Cn Range("a2").CopyFromRecordset Rs Rs.Close Set Rs = Nothing Set Cn = Nothing End If End Sub
Thanks
Bookmarks