Data is imported in Sheet1 from a csv file, using following VBA code:
Worksheets(strTargetSheet).Activate
Range("A1").Select
With Selection.QueryTable
.Connection = _
"TEXT;" & CSVFileLocation & "\" & strImportFile
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileCommaDelimiter = True
.TextFilePromptOnRefresh = False
.Refresh BackgroundQuery:=False
End With
Sheet2 is a second sheet, that agregates data from Sheet1 and has formulas like:
=Sheet1.R5+Sheet1.R7
After the CSV Import routine is executed, the formulas in Sheet2 have all changed and point to column "T" instead of column "R". Eg
=Sheet1.T5+Sheet1.T7
However my data has been imported ok in Sheet1 in column R.
Therefore all the cells in Sheet2 are blank as they point to column T where there is no data.
Note that formulas for columns A-Q are left ok - did not change. Only formulas in column R have been messed up.
Any ideas??
Worksheets(strTargetSheet).Activate
Range("A1").Select
With Selection.QueryTable
.Connection = _
"TEXT;" & CSVFileLocation & "\" & strImportFile
.TextFilePlatform = xlWindows
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileCommaDelimiter = True
.TextFilePromptOnRefresh = False
.Refresh BackgroundQuery:=False
End With
Sheet2 is a second sheet, that agregates data from Sheet1 and has formulas like:
=Sheet1.R5+Sheet1.R7
After the CSV Import routine is executed, the formulas in Sheet2 have all changed and point to column "T" instead of column "R". Eg
=Sheet1.T5+Sheet1.T7
However my data has been imported ok in Sheet1 in column R.
Therefore all the cells in Sheet2 are blank as they point to column T where there is no data.
Note that formulas for columns A-Q are left ok - did not change. Only formulas in column R have been messed up.
Any ideas??