add error cache2

This commit is contained in:
simple321vip
2026-04-20 21:39:53 +08:00
parent 14682d3504
commit 6f2bb324e4
4 changed files with 6 additions and 3 deletions

View File

@@ -281,7 +281,10 @@ private Function RunValidationSilent(ws As Worksheet, Optional ByRef errorCountO
errorCountOut = 0
For r = startRow To lastDataRow
Application.Run validate, ws, r, lastDataRow
If Trim(ws.Cells(r, errorCol).Value) <> "" Then
Dim errorMessage As String : errorMessage = Trim(ws.Cells(r, errorCol).Value)
Dim errorCode As String: errorCode = GetCode(errorMessage)
If errorCode <> "W001" And errorCode <> "" Then
MsgBox errorMessage
errorCountOut = errorCountOut + 1
End If
Next r

View File

@@ -324,7 +324,7 @@ Function GetErrorMsg(ByVal errorCode As String, Optional ByVal param As String =
Dim errorList As Object: Set errorList = GetErrorList()
Dim errorMessage As String
If errorList.Exists(errorCode) Then
errorMessage = Replace(errorList(errorCode)(0), "{0}", param)
errorMessage = MakeSelect(errorCode, Replace(errorList(errorCode)(0), "{0}", param))
End If
GetErrorMsg = errorMessage
End Function