On 23/06/2013 3:29 PM, Le_Forgeron wrote:
> Excel... isn't there some macro language in that flipper ? (or is it a
> flight simulator ? or doom-like ?)
Yes there is. Andrew can record a macro then either edit it to be able
to change the name of the file of keep the name of the input file the same.
Sample code:
Sub Macro6()
'
' Macro6 Macro
'
'
Columns("A:B").Select
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Users\Stephen\Documents\Book2.csv",
Destination:=Range("$A$1"))
.Name = "Book2_1"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 850
.TextFileStartRow = 1
.TextFileParseType = xlDelimited
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = True
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(1, 1)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
ActiveSheet.Shapes.AddChart.Select
ActiveChart.ChartType = xlXYScatterLinesNoMarkers
ActiveChart.SetSourceData Source:=Range("Sheet4!$A:$B")
End Sub
--
Regards
Stephen
Post a reply to this message
|