Hi and thanks in advance!
I am Trying to get a big data from a closed workbook within the activesheet
I have seen the following macro:
but dont know how to paste the data I guess this macro takes
so I am at present here:
'I would like to paste the data within the ActiveSheet
'but don't know how to do this????????????
'Your range where you want to paste data to.CopyFromRecordset rs
I am Trying to get a big data from a closed workbook within the activesheet
I have seen the following macro:
Code:
Sub Pulldata()
'NEBU's code
On Error Resume Next: Application.ScreenUpdating = False
Dim wsXXX As String: wsXXX = Hoja030.Name
Dim wsSHT As String: wsSHT = "PROJECTION"
Dim rs As ADODB.Recordset
Dim qry As String: qry = "SELECT * FROM [" & wsSHT & "$] "
Dim fName As String: fName = "X:\Projects\xRetail\Excels\AAAA.xlsx"
Dim Str As String: Str = "Provider=Microsoft.ACE.OLEDB.12.0;" & "Data Source=" & fName & ";" & "Extended Properties=Excel 12.0"
Dim xRow As Long: xRow = 1
Set rs = New ADODB.Recordset
rs.Open qry, Str, adOpenUnspecified, adLockUnspecified
'I would like to paste the data within the ActiveSheet
'On ActiveSheet.cells(1,1) so on but don't know how to do this????????????
'Your range where you want to paste data to.CopyFromRecordset rs
Application.ScreenUpdating = True
End Sub
but dont know how to paste the data I guess this macro takes
so I am at present here:
'I would like to paste the data within the ActiveSheet
'but don't know how to do this????????????
'Your range where you want to paste data to.CopyFromRecordset rs