Advertisement
YasserKhalil2019

T4322_Check Expired Items Using Loops

Nov 16th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.68 KB | None | 0 0
  1. https://excel-egy.com/forum/t4322
  2. ----------------------------------
  3.  
  4. Sub Check_Expired_Items_Using_Loops()
  5. Dim b As Boolean, s As String, r As Long
  6.  
  7. With ThisWorkbook.Worksheets(1)
  8. s = "لديك أصناف منتهية الصلاحية" & vbNewLine & "----------------------------------"
  9.  
  10. For r = 2 To .Cells(Rows.Count, 1).End(xlUp).Row
  11. If .Cells(r, 5).Value = 10 Then
  12. b = True
  13. .Cells(r, 6).Value = "expired"
  14. s = s & vbNewLine & .Cells(r, 4) & vbTab & vbTab & .Cells(r, 2)
  15. End If
  16. Next r
  17.  
  18. If b Then MsgBox s: UserForm1.Show
  19. End With
  20. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement