Remove redundant GHI empty check

This commit is contained in:
updsv7
2026-04-13 15:56:22 +09:00
parent d71ac70677
commit aab3708a22

View File

@@ -334,20 +334,18 @@ Sub validateDetailData(ByVal ws As Worksheet, ByVal rowNum As Long)
h = Trim(ws.Cells(rowNum, 8).Value) h = Trim(ws.Cells(rowNum, 8).Value)
i = Trim(ws.Cells(rowNum, 9).Value) i = Trim(ws.Cells(rowNum, 9).Value)
If g <> "" And h <> "" And i <> "" Then lastRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
lastRow = ws.Cells(ws.Rows.Count, "C").End(xlUp).Row
For r = 7 To lastRow
For r = 7 To lastRow If r <> rowNum And Trim(ws.Cells(r, 3).Value) = Trim(ws.Cells(rowNum, 3).Value) Then
If r <> rowNum And Trim(ws.Cells(r, 3).Value) = Trim(ws.Cells(rowNum, 3).Value) Then If Trim(ws.Cells(r, 7).Value) = g And _
If Trim(ws.Cells(r, 7).Value) = g And _ Trim(ws.Cells(r, 8).Value) = h And _
Trim(ws.Cells(r, 8).Value) = h And _ Trim(ws.Cells(r, 9).Value) = i Then
Trim(ws.Cells(r, 9).Value) = i Then ws.Cells(rowNum, 17).Value = "GHI combination already exists"
ws.Cells(rowNum, 17).Value = "GHI combination already exists" Exit Sub
Exit Sub
End If
End If End If
Next r End If
End If Next r
' Validation passed ' Validation passed
ws.Cells(rowNum, 17).ClearContents ws.Cells(rowNum, 17).ClearContents