|
イマイチ意味が分かりませんが、複数の変数の値を全て連結して、文字列にすれば
良いと思います。
Sub Test_Write()
Dim A As Integer, B As Integer
Dim C As Integer, D As Integer, E As Integer
Dim Ary As Variant
Dim Buf As String
Const MyF As String = _
"C:\Documents and Settings\User\My Documents\Test.txt"
'↑仮のパスです。
A = 10: B = 11: C = 12: D = 0: E = -12
Ary = Array(A, B, C, D, E)
Buf = Join(Ary, ",")
Open MyF For OutPut Access Write As #1
Print #1, Buf
Close #1
End Sub
などと。
>データの読み取りの方法
は、逆に Input# を使います。
Sub Test_Read()
Dim Buf As String, StV As String
Const MyF As String = _
"C:\Documents and Settings\User\My Documents\Test.txt"
Open MyF For Input Access Read As #1
Do Until EOF(1)
Buf = ""
Input #1, Buf
StV = StV & Buf & ","
Loop
Close #1
MsgBox Left$(StV, Len(StV) - 1)
End Sub
|
|