I have a query:
Then, I put the result in a worksheet
Instead of pasting it in a worksheet, I would like to put the result directly in an array without loosing the time to passing via a worksheet
Many thanks for helping me out
Code:
Bron = Excel.CurrentWorkbook(){[Name=""Finost_OI_1""]}[Content]," & Chr(13) & "" & Chr(10) & _
" #""Type gewijzigd"" = Table.TransformColumnTypes(Bron,{{""Date"", type date}, {""ArtNr"", type text}})," & Chr(13) & "" & Chr(10) & _
" #""Rijen gefilterd"" = Table.SelectRows(#""Type gewijzigd"", each Text.Contains([ArtNr], ""DEP"") or Text.Contains([ArtNr], ""H0O""))," & Chr(13) & "" & Chr(10) & _
" #""Kolommen verwijderd"" = Table.RemoveColumns(#""Rijen gefilterd"",{""AcNr"", ""AcName"", ""Discs"", ""Remarks""})" & Chr(13) & "" & Chr(10) & "in" & Chr(13) & "" & Chr(10) & " #""Kolommen verwijderd"""
Code:
Worksheets.Add(After:=Worksheets("Print2")).Name = "Temp"
With ActiveSheet.ListObjects.Add(SourceType:=0, Source:="OLEDB;Provider=Microsoft.Mashup.OleDb.1;Data Source=$Workbook$;Location=QueryTab;Extended Properties=""""", Destination:=Range("$A$1")).QueryTable
.CommandType = xlCmdSql
.CommandText = Array("SELECT * FROM [QueryTab]")
.ListObject.DisplayName = QT
.Refresh BackgroundQuery:=False
End With
ActiveWorkbook.Queries(QT).Delete
End Sub
Many thanks for helping me out