ExcelVBA/CSVなど表形式のデータをLDIFなどの形式に変換するためのマクロ
をテンプレートにして作成
[
トップ
] [
新規
|
一覧
|
検索
|
最終更新
|
ヘルプ
]
開始行:
#navi(../)
-CSVなど表形式のデータをLDIFなどの形式に変換するためのマ...
Option Explicit
Sub test()
Dim varValueData() As Variant '//2次元配列データ
Dim strRowData(1000) As String '//1行のデータを連...
Dim strTemp As String
Dim m As Long
Dim n As Long
Dim h As Long
varValueData = ThisWorkbook.Worksheets("sheet2").Ra...
'取得できた全データ書き出しと連結格納
'ReDim strRowData(LBound(varValueData, 1) To UBound...
h = 1
For m = LBound(varValueData, 1) To UBound(varValueD...
For n = LBound(varValueData, 2) To UBound(varVa...
h = h + 1
strTemp = ""
Debug.Print "[" & CStr(m) & ":" & CStr(n) &...
strTemp = CStr(varValueData(m, n))
strRowData(h) = strTemp
Debug.Print strTemp
Call actPrint(strTemp)
Next
Next
End Sub
Function actPrint(strTemp As String)
Dim intFF As Integer ' FreeFile値
Const cnsFILENAME = "\SAMPLE.txt"
' FreeFile値の取得(以降この値で入出力する)
intFF = FreeFile
' 指定ファイルをOPEN(出力モード)
Open ThisWorkbook.Path & cnsFILENAME For Append As ...
Print #intFF, strTemp
Close #intFF
Debug.Print strTemp
End Function
#navi(../)
終了行:
#navi(../)
-CSVなど表形式のデータをLDIFなどの形式に変換するためのマ...
Option Explicit
Sub test()
Dim varValueData() As Variant '//2次元配列データ
Dim strRowData(1000) As String '//1行のデータを連...
Dim strTemp As String
Dim m As Long
Dim n As Long
Dim h As Long
varValueData = ThisWorkbook.Worksheets("sheet2").Ra...
'取得できた全データ書き出しと連結格納
'ReDim strRowData(LBound(varValueData, 1) To UBound...
h = 1
For m = LBound(varValueData, 1) To UBound(varValueD...
For n = LBound(varValueData, 2) To UBound(varVa...
h = h + 1
strTemp = ""
Debug.Print "[" & CStr(m) & ":" & CStr(n) &...
strTemp = CStr(varValueData(m, n))
strRowData(h) = strTemp
Debug.Print strTemp
Call actPrint(strTemp)
Next
Next
End Sub
Function actPrint(strTemp As String)
Dim intFF As Integer ' FreeFile値
Const cnsFILENAME = "\SAMPLE.txt"
' FreeFile値の取得(以降この値で入出力する)
intFF = FreeFile
' 指定ファイルをOPEN(出力モード)
Open ThisWorkbook.Path & cnsFILENAME For Append As ...
Print #intFF, strTemp
Close #intFF
Debug.Print strTemp
End Function
#navi(../)
ページ名: