通勤認定エクセルツール対応13 M1 対応2

This commit is contained in:
guanxiangwei
2026-05-28 20:57:47 +09:00
parent 50ef0c74cc
commit 29c9200132
15 changed files with 730 additions and 318 deletions

View File

@@ -51,20 +51,19 @@ Private Sub Worksheet_Change(ByVal Target As Range)
If z4Rosen.Exists(kikanName) Then
Call BuildZ4StationFromDropdown(Me, "F", cellD.Row, kikanName)
Dim fromStations As Object: Set fromStations = z4Rosen(kikanName)
Dim stations As Object: Set stations = z4Rosen(kikanName)
Dim fromCell As Range: Set fromCell = Me.Cells(cellD.Row, 6)
Dim fromStation As String: fromStation = Trim(fromCell.Value)
If Not fromStations.Exists(fromStation) Or fromStation = "" Then
If Not stations.Exists(fromStation) Or fromStation = "" Then
fromCell.ClearContents
Me.Cells(cellD.Row, 7).ClearContents
Me.Cells(cellD.Row, 7).Validation.Delete
Else
Call BuildZ4StationToDropdown(Me, "G", cellD.Row, kikanName, fromStation)
Dim toStations As Object: Set toStations = fromStations(fromStation)
Dim toCell As Range: Set toCell = Me.Cells(cellD.Row, 7)
Dim toStation As String: toStation = Trim(toCell.Value)
If Not toStations.Exists(fromStation) Or toStation = "" Then
If Not stations.Exists(toStation) Or toStation = "" Then
toCell.ClearContents
End If
End If
@@ -264,9 +263,9 @@ Private Sub ValidateWarn(ws As Worksheet, ByVal lastDataRow As Long)
' Get M2 sheet kukan code list directly
Dim sheetConfDict As Object: Set sheetConfDict = GetSheetConfig()
Dim m2SheetConf As Object: Set m2SheetConf = sheetConfDict("M2")
Dim m2SheetConf As Object: Set m2SheetConf = sheetConfDict(CACHE_M2)
Dim m2StartRow As Long: m2StartRow = m2SheetConf("StartRow")
Dim wsM2 As Worksheet: Set wsM2 = ThisWorkbook.Worksheets("M2")
Dim wsM2 As Worksheet: Set wsM2 = ThisWorkbook.Worksheets(CACHE_M2)
Dim lastRowM2 As Long: lastRowM2 = GetLastDataRowInRange(wsM2)
If lastRowM2 < m2StartRow Then
exitMsg = "M2 sheet has no data"