Change error column to S (19)

This commit is contained in:
updsv7
2026-04-13 16:48:08 +09:00
parent 014a585396
commit ab0871edf9

View File

@@ -68,7 +68,7 @@ Sub ClearRowData(ByVal ws As Worksheet, ByVal rowNum As Long)
' Clear from D column onwards
ws.Range(ws.Cells(rowNum, 4), ws.Cells(rowNum, 15)).ClearContents
ws.Cells(rowNum, 6).Validation.Delete
ws.Cells(rowNum, 17).ClearContents ' Q column error info
ws.Cells(rowNum, 19).ClearContents ' Q column error info
End Sub
Sub MakeFDropdownByG(ByVal ws As Worksheet, ByVal rowNum As Long)
@@ -280,35 +280,35 @@ End Function
Sub validateDetailData(ByVal ws As Worksheet, ByVal rowNum As Long)
' Check C column not empty
If Trim(ws.Cells(rowNum, 3).Value) = "" Then
ws.Cells(rowNum, 17).ClearContents
ws.Cells(rowNum, 19).ClearContents
Exit Sub
End If
' Check G, H required and numeric (for composite key)
If Trim(ws.Cells(rowNum, 9).Value) = "" Or Not IsNumeric(ws.Cells(rowNum, 9).Value) Then
ws.Cells(rowNum, 17).Value = "G column (I) is required and must be numeric"
ws.Cells(rowNum, 19).Value = "G column (I) is required and must be numeric"
Exit Sub
End If
If Trim(ws.Cells(rowNum, 10).Value) = "" Or Not IsNumeric(ws.Cells(rowNum, 10).Value) Then
ws.Cells(rowNum, 17).Value = "H column (J) is required and must be numeric"
ws.Cells(rowNum, 19).Value = "H column (J) is required and must be numeric"
Exit Sub
End If
' Check I (K column) required
If Trim(ws.Cells(rowNum, 11).Value) = "" Then
ws.Cells(rowNum, 17).Value = "I column (K) is required"
ws.Cells(rowNum, 19).Value = "I column (K) is required"
Exit Sub
End If
' Check J, K required and numeric
If Trim(ws.Cells(rowNum, 12).Value) = "" Or Not IsNumeric(ws.Cells(rowNum, 12).Value) Then
ws.Cells(rowNum, 17).Value = "J column (L) is required and must be numeric"
ws.Cells(rowNum, 19).Value = "J column (L) is required and must be numeric"
Exit Sub
End If
If Trim(ws.Cells(rowNum, 13).Value) = "" Or Not IsNumeric(ws.Cells(rowNum, 13).Value) Then
ws.Cells(rowNum, 17).Value = "K column (M) is required and must be numeric"
ws.Cells(rowNum, 19).Value = "K column (M) is required and must be numeric"
Exit Sub
End If
@@ -321,7 +321,7 @@ Sub validateDetailData(ByVal ws As Worksheet, ByVal rowNum As Long)
For col = 14 To 18
If Trim(ws.Cells(rowNum, col).Value) <> "" And Not IsNumeric(ws.Cells(rowNum, col).Value) Then
colName = Mid(colLetter, col - 13, 1)
ws.Cells(rowNum, 17).Value = colName & " column must be numeric"
ws.Cells(rowNum, 19).Value = colName & " column must be numeric"
Exit Sub
End If
Next col
@@ -339,14 +339,14 @@ Sub validateDetailData(ByVal ws As Worksheet, ByVal rowNum As Long)
For r = 7 To lastRow
If r <> rowNum And Trim(ws.Cells(r, 3).Value) = Trim(ws.Cells(rowNum, 3).Value) Then
If Trim(ws.Cells(r, 9).Value) = g And Trim(ws.Cells(r, 10).Value) = h Then
ws.Cells(rowNum, 17).Value = "GH (I,J) combination already exists"
ws.Cells(rowNum, 19).Value = "GH (I,J) combination already exists"
Exit Sub
End If
End If
Next r
' Validation passed
ws.Cells(rowNum, 17).ClearContents
ws.Cells(rowNum, 19).ClearContents
End Sub