20260515指摘対応
This commit is contained in:
@@ -141,6 +141,8 @@ Private Sub Do_Validation(ws As Excel.Worksheet)
|
||||
MsgBox "Validation complete. Errors: 0", vbInformation
|
||||
End If
|
||||
|
||||
Do_Fit ws
|
||||
|
||||
Exit Sub
|
||||
|
||||
ErrorHandler:
|
||||
@@ -288,7 +290,8 @@ Private Sub Do_Fit(ws As Excel.Worksheet)
|
||||
Dim sheetConfDict As Object: Set sheetConfDict = GetSheetConfig()
|
||||
Dim sheetConf As Object: Set sheetConf = sheetConfDict(ws.CodeName)
|
||||
|
||||
Dim startCol As String: startCol = sheetConf("StartCol")
|
||||
' 2026-05-15 adjust width function contains error column
|
||||
Dim startCol As String: startCol = sheetConf("ErrorCol")
|
||||
Dim endCol As String: endCol = sheetConf("EndCol")
|
||||
|
||||
ws.Columns(startCol & ":" & endCol).AutoFit
|
||||
|
||||
@@ -313,17 +313,21 @@ Function CheckHeaderEdit(ByVal ws As Worksheet, ByVal Target As Range) As Boolea
|
||||
Dim sheetConfDict As Object: Set sheetConfDict = GetSheetConfig()
|
||||
Dim sheetConf As Object: Set sheetConf = sheetConfDict(ws.CodeName)
|
||||
Dim headerRow As Long: headerRow = sheetConf("HeaderRow")
|
||||
Dim filterRow As Long: filterRow = sheetConf("FilterRow")
|
||||
|
||||
' Check header row (headerRow) cannot be edited
|
||||
If Target.Row = headerRow Then
|
||||
Application.EnableEvents = False
|
||||
MsgBox "Header row can not be edit", vbExclamation
|
||||
Application.Undo
|
||||
Application.EnableEvents = True
|
||||
Dim r As Long
|
||||
For r = Target.Row To Target.Row + Target.Rows.Count - 1
|
||||
If r = headerRow Or r = filterRow Then
|
||||
Application.EnableEvents = False
|
||||
MsgBox "Header or type definition row cannot be edited.", vbExclamation
|
||||
Application.Undo
|
||||
Application.EnableEvents = True
|
||||
|
||||
CheckHeaderEdit = True
|
||||
Exit Function
|
||||
End If
|
||||
CheckHeaderEdit = True
|
||||
Exit Function
|
||||
End If
|
||||
Next r
|
||||
|
||||
CheckHeaderEdit = False
|
||||
End Function
|
||||
|
||||
@@ -305,7 +305,7 @@ Private Sub RefreshSheetDict()
|
||||
Set sheetConf = CreateObject("Scripting.Dictionary")
|
||||
sheetConf("StartCol") = "C"
|
||||
sheetConf("EndCol") = "BC"
|
||||
sheetConf("ErrorCol") = "BD"
|
||||
sheetConf("ErrorCol") = "B"
|
||||
sheetConf("StartRow") = 8
|
||||
sheetConf("HeaderRow") = 6
|
||||
sheetConf("CSV_Encoding") = "shift_jis"
|
||||
@@ -321,7 +321,7 @@ Private Sub RefreshSheetDict()
|
||||
Set sheetConf = CreateObject("Scripting.Dictionary")
|
||||
sheetConf("StartCol") = "C"
|
||||
sheetConf("EndCol") = "N"
|
||||
sheetConf("ErrorCol") = "O"
|
||||
sheetConf("ErrorCol") = "B"
|
||||
sheetConf("StartRow") = 7
|
||||
sheetConf("HeaderRow") = 5
|
||||
sheetConf("CacheName") = "m1Cache"
|
||||
@@ -340,15 +340,15 @@ Private Sub RefreshSheetDict()
|
||||
Set sheetConf = CreateObject("Scripting.Dictionary")
|
||||
sheetConf("StartCol") = "C"
|
||||
sheetConf("EndCol") = "R"
|
||||
sheetConf("ErrorCol") = "S"
|
||||
sheetConf("StartRow") = 7
|
||||
sheetConf("ErrorCol") = "B"
|
||||
sheetConf("StartRow") = 8
|
||||
sheetConf("HeaderRow") = 6
|
||||
sheetConf("CSV_Encoding") = "shift_jis"
|
||||
sheetConf("HasHeader") = True
|
||||
sheetConf("ExpectedColumnCount") = 11
|
||||
sheetConf("HeaderColumns") = Array("C", "I", "J", "K", "L", "M", "N", "O", "P", "Q", "R")
|
||||
sheetConf("AlwaysQuote") = False
|
||||
sheetConf("FilterRow") = 6
|
||||
sheetConf("FilterRow") = 7
|
||||
Set sheetConfDict("M2") = sheetConf
|
||||
Debug.Print "RefreshSheetDict M2 ok."
|
||||
|
||||
@@ -482,11 +482,11 @@ Private Sub RefreshSheetDict()
|
||||
Set sheetConf = CreateObject("Scripting.Dictionary")
|
||||
sheetConf("StartCol") = "C"
|
||||
sheetConf("EndCol") = "F"
|
||||
sheetConf("ErrorCol") = ""
|
||||
sheetConf("ErrorCol") = "B"
|
||||
sheetConf("StartRow") = 6
|
||||
sheetConf("HeaderRow") = ""
|
||||
sheetConf("CSV_Encoding") = "utf-8"
|
||||
sheetConf("HasHeader") = False
|
||||
sheetConf("HeaderRow") = "5"
|
||||
sheetConf("CSV_Encoding") = "shift_jis"
|
||||
sheetConf("HasHeader") = True
|
||||
sheetConf("ExpectedColumnCount") = 4
|
||||
sheetConf("HeaderColumns") = Array("C", "D", "E", "F")
|
||||
sheetConf("AlwaysQuote") = True
|
||||
@@ -498,9 +498,9 @@ Private Sub RefreshSheetDict()
|
||||
Set sheetConf = CreateObject("Scripting.Dictionary")
|
||||
sheetConf("StartCol") = "C"
|
||||
sheetConf("EndCol") = "O"
|
||||
sheetConf("ErrorCol") = ""
|
||||
sheetConf("ErrorCol") = "B"
|
||||
sheetConf("StartRow") = 6
|
||||
sheetConf("HeaderRow") = ""
|
||||
sheetConf("HeaderRow") = "5"
|
||||
sheetConf("CSV_Encoding") = "utf-8"
|
||||
sheetConf("HasHeader") = False
|
||||
sheetConf("ExpectedColumnCount") = 13
|
||||
|
||||
Reference in New Issue
Block a user