di mary73 » 27/04/15 15:24
Ciao ho eseguito esattamente quello che mi hai suggerito e questo è il codice che trovo:
Prova Macro
'
'
Sheets("Foglio2").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\edipi9o\BET 001 € Best Estimate and Budget Analysis (Production Cost).txt" _
, Destination:=Range("$A$1"))
.Name = "BET 001 € Best Estimate and Budget Analysis (Production Cost)"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 65001
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, _
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 _
, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
Sheets("PIVOT").Select
ActiveSheet.PivotTables("Tabella_pivot1").ChangePivotCache ActiveWorkbook. _
PivotCaches.Create(SourceType:=xlDatabase, SourceData:= _
"C:\ALFRESCO\NUOVA BET\2015\Aprile\Versione 2\[BET 001 Aprile 2015 (Weekly Versione 2) Total Group.xlsx]Foglio2!R5C1:R11120C77" _
, Version:=xlPivotTableVersion12)
End Sub