|
▼質問 さん:
こんにちは。
モードをバイナリにしても出来ますが、固定長と言うのなら、
ランダムにしたほうがわかりやすいですよ!!
'=============================
Type recFormat
f1 As String * 2
f2 As String * 2
f3 As String * 2
crlf As String * 2
End Type
'=====================
Sub test()
Dim rFormat As recFormat
Dim fN As Integer
Dim myPath As String
Dim mArray
Dim i As Long
fN = FreeFile
myPath = ThisWorkbook.Path
Open myPath & "\AAAAAA.dat" For Random As #fN Len = Len(rFormat)
mArray = Range("A1").CurrentRegion.Value
For i = 1 To UBound(mArray, 1)
With rFormat
RSet .f1 = Len(mArray(i, 1))
RSet .f2 = mArray(i, 2)
RSet .f3 = mArray(i, 3)
.crlf = vbCrLf
End With
Put #fN, , rFormat
Next
Close #fN
End Sub
|
|