Relleboer
Gebruiker
- Lid geworden
- 6 okt 2006
- Berichten
- 264
Ik heb thuis(excel2003) onderstaande code geschreven voor op het werk(excel2000). wie kan mij hem vertalen na excel2000. in het rood de stukken waar hij dus op vast loopt
Code:
Sub Data()
Dim fd As [COLOR="Red"]FileDialog[/COLOR]
Set fd = Application.[COLOR="red"]FileDialog(msoFileDialogFilePicker)[/COLOR]
Dim vrtSelectedItem As Variant
With fd
[COLOR="Red"] .Filters.Clear
.Filters.Add "Tekstbestanden", "*.txt"
If .Show = -1 Then[/COLOR]
For Each vrtSelectedItem In .SelectedItems
file = vrtSelectedItem
Workbooks.OpenText Filename:= _
file, Origin _
:=xlMSDOS, StartRow:=1, DataType:=xlFixedWidth, FieldInfo:=Array(Array(0 _
, 1), Array(13, 1), Array(16, 1), Array(25, 1), Array(33, 1), Array(42, 1), Array(49, 1), _
Array(57, 1), Array(65, 1)), [COLOR="red"]TrailingMinusNumbers:=True[/COLOR]
Sheets(1).Move After:=Workbooks("Data spuitgiet R&D.xls").Sheets(1)
Columns("A:A").Delete Shift:=xlToLeft
Range("A1").SpecialCells(xlCellTypeBlanks).Delete Shift:=xlUp
Rows("1:1").Insert Shift:=xlDown
Range("a1").Value = "Preform number"
Range("b1").Value = "Injection pressure"
Range("c1").Value = "Cycle time"
Range("d1").Value = "Recovery"
Next vrtSelectedItem
Else
End If
End With
Set fd = Nothing
End Sub
Laatst bewerkt: