From 0c64a6f5e9fa6685e94496e14cd8e5366b5f8eb5 Mon Sep 17 00:00:00 2001 From: updsv7 Date: Mon, 13 Apr 2026 15:11:54 +0900 Subject: [PATCH] Add row counter in export --- vba_code_kukan_detail_master.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/vba_code_kukan_detail_master.txt b/vba_code_kukan_detail_master.txt index 3c49152..587c73f 100644 --- a/vba_code_kukan_detail_master.txt +++ b/vba_code_kukan_detail_master.txt @@ -390,10 +390,15 @@ Sub ExportMasterDetailData() Dim csvContent As String csvContent = CSV_HEADER & vbLf + ' Row counter + Dim rowCount As Long + rowCount = 0 + ' Data: C,G,H,I,J,K,L,M,N,O,P (skip D,E,F) Dim r As Long For r = 7 To lastDataRow If Len(Trim(ws.Cells(r, 3).Value & "")) > 0 Then + rowCount = rowCount + 1 ' CSV col1 -> C column csvContent = csvContent & CleanCSVField(ws.Cells(r, 3).Value) ' CSV col2-11 -> G-P column @@ -414,5 +419,5 @@ Sub ExportMasterDetailData() stream.SaveToFile savePath, 2 stream.Close - MsgBox "CSV export completed.", vbInformation + MsgBox "CSV export completed. Total rows: " & (rowCount + 1), vbInformation End Sub \ No newline at end of file