View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
ALEX ALEX is offline
external usenet poster
 
Posts: 493
Default make signed over-punch conversion work in a macro

Sub VBA()
'
' VBA Macro
' Macro recorded 1/3/2007 by Alex
'

'
With ActiveSheet.QueryTables.Add(Connection:= _
"TEXT;C:\Documents and Settings\Owner\Desktop\DLTest.txt",
Destination:= _
Range("A1"))
.Name = "DLTest"
.FieldNames = True
.RowNumbers = False
.FillAdjacentFormulas = False
.PreserveFormatting = True
.RefreshOnFileOpen = False
.RefreshStyle = xlInsertDeleteCells
.SavePassword = False
.SaveData = True
.AdjustColumnWidth = True
.RefreshPeriod = 0
.TextFilePromptOnRefresh = False
.TextFilePlatform = 437
.TextFileStartRow = 1
.TextFileParseType = xlFixedWidth
.TextFileTextQualifier = xlTextQualifierDoubleQuote
.TextFileConsecutiveDelimiter = False
.TextFileTabDelimiter = True
.TextFileSemicolonDelimiter = False
.TextFileCommaDelimiter = False
.TextFileSpaceDelimiter = False
.TextFileColumnDataTypes = Array(2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2,
1, 1, 1, 1, 1, 2, 2, 5, 2, _
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 5, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 1, 2, 1, 2, 2, 2, 1, 5)
.TextFileFixedColumnWidths = Array(1, 10, 5, 12, 7, 8, 11, 30, 2, 5,
3, 2, 6, 6, 6, 6, 6, 12, 15, 8, 1, _
18, 1, 15, 3, 3, 10, 6, 12, 15, 12, 7, 2, 2, 8, 1, 3, 1, 1, 1, 2,
2, 1, 2, 10, 5, 1, 15, 4, 1, 6, 1, 9, 26, 6, 6)
.TextFileTrailingMinusNumbers = True
.Refresh BackgroundQuery:=False
End With
ActiveWindow.SmallScroll Down:=-9
Range("A1").Select
Range("A1:AF69").Sort Key1:=Range("A1"), Order1:=xlAscending, Header:= _
xlGuess, OrderCustom:=1, MatchCase:=False,
Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
Rows("1:9").Select
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=-15
Rows("1:1").Select
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=30
Rows("52:59").Select
Selection.Delete Shift:=xlUp
ActiveWindow.SmallScroll Down:=-51
Rows("1:1").Select
Selection.Insert Shift:=xlDown
Call VBAHeader
End Sub

Where and what syntax to use in the above macro using VBA?