fork download
  1. Public Sub 特定行表示()
  2. Dim ws As Worksheet
  3. Dim wrow As Long
  4. Dim hide_rows As Range
  5. Dim lastrow As Long
  6. Dim flag As Boolean
  7. Dim match_ctr As Long: match_ctr = 0
  8. Set ws = Worksheets("オーダーリスト")
  9. lastrow = ws.Cells(Rows.Count, "A").End(xlUp).Row
  10. ws.Rows("6:" & Rows.Count).Hidden = False
  11. Set hide_rows = Nothing
  12. For wrow = 6 To lastrow
  13. flag = False
  14. If ws.Cells(wrow, "E").Value = "重複" Then
  15. flag = True
  16. End If
  17. If ws.Cells(wrow, "B").Value = "" Or ws.Cells(wrow, "C").Value = "" Or ws.Cells(wrow, "D").Value = "" Then
  18. flag = True
  19. End If
  20. If flag = False Then
  21. If hide_rows Is Nothing Then
  22. Set hide_rows = Rows(wrow)
  23. Else
  24. Set hide_rows = Union(hide_rows, Rows(wrow))
  25. End If
  26. Else
  27. match_ctr = match_ctr + 1
  28. End If
  29. Next
  30. If match_ctr = 0 Then
  31. MsgBox ("重複や空白なし")
  32. Else
  33. If Not hide_rows Is Nothing Then
  34. hide_rows.EntireRow.Hidden = True
  35. End If
  36. End If
  37. End Sub
  38.  
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty