20260515指摘対応3

This commit is contained in:
guanxiangwei
2026-05-15 18:33:15 +09:00
parent fa8bd26757
commit 553148202c
5 changed files with 130 additions and 30 deletions

View File

@@ -165,3 +165,24 @@ Private Sub Validate(ws As Worksheet, ByVal rowNum As Long, ByVal lastDataRow As
' Validation passed - clear error
ws.Cells(rowNum, errorCol).ClearContents
End Sub
' obtain z1 master data, and update column E
Private Sub Refresh(ws As Worksheet, ByVal startRow As Long, ByVal lastDataRow As Long)
Dim z1Cache As Object: Set z1Cache = GetCache("Z1")
If z1Cache Is Nothing Then Exit Sub
Application.EnableEvents = False
On Error GoTo Finally
Dim r As Long
For r = startRow To lastDataRow
Dim dVal As String: dVal = Trim(ws.Cells(r, 4).Value) ' Column D
If dVal <> "" And z1Cache.Exists(dVal) Then
Dim valsD As Variant: valsD = z1Cache(dVal)
ws.Cells(r, 5).Value = valsD(0) ' Column E
End If
Next r
Finally:
Application.EnableEvents = True
End Sub