Advertisement
YasserKhalil2019

T4090_Get Value By Name And Latest Date

Oct 12th, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. https://excel-egy.com/forum/t4090
  2. ---------------------------------
  3.  
  4. Private Sub TextBox1_AfterUpdate()
  5. Dim x, v, b As Boolean, r As Long, m As Long
  6.  
  7. For r = Cells(Rows.Count, 2).End(xlUp).Row To 2 Step -1
  8. If TextBox1.Value = Cells(r, 2).Value And Cells(r, 11).Value > 0 Then
  9. v = Cells(r, 6).Value2
  10. If v > x Then b = True: x = v: m = r
  11. End If
  12. Next r
  13.  
  14. If b Then TextBox2.Value = Cells(m, 11).Value Else TextBox2.Value = ""
  15. End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement