Dynamic pivottables
Do While qCount < 5
Set NewSheet = Sheets.Add(Type:=xlWorksheet)
fir = firm & qCount & loppu
With ActiveSheet.QueryTables.Add(Connection:= _
"FINDER;file:///H:" & fir, Destination:=Range("A1"))
.Name = "Qval"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.BackgroundQuery = True
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.WebSelectionType = xlSpecifiedTables
.WebFormatting = xlWebFormattingNone
.WebTables = "4,5"
.WebPreFormattedTextToColumns = True
.WebConsecutiveDelimitersAsOne = True
.WebSingleBlockTextImport = False
.WebDisableDateRecognition = False
.WebDisableRedirections = False
.Refresh BackgroundQuery:=False
End With
ActiveSheet.Name = apuFirma(laskuri) & "Q" & qCount
qCount = qCount + 1
Loop
Here is the working code also. Pivottables not pivotcaches, my bad on
former message.
|