|
参考になるかわからんが100×100の範囲の0〜255の数字を
テキストファイルに読み書きするマクロ
Sub syuturyoku()
Dim a, b(99, 99) As Byte, c, d, e
For d = 0 To 99
For e = 0 To 99
b(d, e) = Cells(d + 1, e + 1)
Next
Next
a = FreeFile
c = ThisWorkbook.Path & "\a"
Do
If Dir(c & ".txt") = "" Then Exit Do
c = c & "a"
Loop
Open c & ".txt" For Binary As #a
Put #a, 1, b
Close #a
End Sub
Sub nyuuryoku()
Dim a, b(99, 99) As Byte, c, d, e
a = FreeFile
c = Application.GetOpenFilename
If c = "False" Then Exit Sub
Open c For Binary As #a
Get #a, 1, b
Close #a
Application.ScreenUpdating = False
For d = 0 To 99
For e = 0 To 99
Cells(d + 1, e + 1) = b(d, e)
Next
Next
Application.ScreenUpdating = True
End Sub
これの範囲とかを変えてFormulaとか条件文をいい感じに使えばうまくいくとおも
|
|