Add row counter in export

This commit is contained in:
updsv7
2026-04-13 15:11:54 +09:00
parent d2e1a4335d
commit 0c64a6f5e9

View File

@@ -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