マークダウンファイル生成スクリプト修正

This commit is contained in:
2026-04-08 15:39:56 +09:00
parent 3854cdf6d7
commit 52f6ea2c52
4 changed files with 29 additions and 15 deletions

View File

@@ -1,4 +1,7 @@
Sub ExportMarkdown_Complete()
Attribute VB_Name = "Module3"
Sub ExportMarkdown_Complete()
Application.ScreenUpdating = False
'==============================
' 0. 基本情報(変換定義側)
@@ -13,7 +16,7 @@
sheetNames = Split(defWs.Range("C4").Value, vbLf) ' 対象シート(改行区切り)
Dim startRow As Long
startRow = defWs.Range("B5").Value ' 探索開始行
startRow = defWs.Range("C5").Value ' 探索開始行
Dim title As String
title = defWs.Range("N3").Value ' Markdownタイトル
@@ -66,7 +69,7 @@
r = startRow
' 最初の定義列が空になるまで
Do While dataWs.Cells(r, Columns(items.Items()(0)(0)).Column).Value <> ""
Do While dataWs.Cells(r, Columns(items.items()(0)(0)).Column).Value <> ""
Dim md As String
md = template ' ★ テンプレートを複製
@@ -87,6 +90,8 @@
Dim cellValue As String
cellValue = dataWs.Cells(r, colNum).Value
cellValue = Replace(cellValue, vbCrLf, vbLf)
cellValue = Replace(cellValue, Chr(13), vbLf)
Select Case cond
@@ -160,7 +165,7 @@
' 6. Markdown ファイル生成
'==============================
Dim outPath As String
outPath = ThisWorkbook.Path & "\output.md"
outPath = ThisWorkbook.path & "\output.md"
Dim stream As Object
Set stream = CreateObject("ADODB.Stream")
@@ -172,4 +177,7 @@
MsgBox "Markdownファイルを生成しました" & vbCrLf & outPath, vbInformation
End Sub
Application.ScreenUpdating = True
End Sub