View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
Sinner Sinner is offline
external usenet poster
 
Posts: 142
Default Help with macro. Import text file (fixed width)

Hello,

I have the following macro to import a text file (fixed width).

Sub Macro1()
'
' Macro1 Macro
' Macro recorded 24/03/2008 by
'

'
ChDir "C:\Documents and Settings\rambo\Desktop\ST ReCON"
Workbooks.OpenText Filename:= _
"C:\Documents and Settings\rambo\Desktop\ST ReCON\STS 24.TXT",
Origin:= _
437, StartRow:=1, DataType:=xlFixedWidth,
FieldInfo:=Array(Array(0, 1), _
Array(30, 2), Array(42, 1), Array(56, 1), Array(90, 1),
Array(140, 1)), _
TrailingMinusNumbers:=True
Cells.Select
Selection.Columns.AutoFit
ActiveWindow.Zoom = 85

End Sub

Things I want to add a
- Simple button in sheet to start macro
- Ask for text file destination folder
- Delete first 8 rows
- Delete row with 4 or more character '----'
- Delete row with word containing total
- Delete row with 4 or more character '===='
- All data asending order with respect to columnC (entire data & not
just columnC).