SHARE
TWEET

T4322_Check Expired Items Using Loops

YasserKhalil2019 Nov 16th, 2019 (edited) 92 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top