Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- https://excel-egy.com/forum/t3881
- ---------------------------------
- Private Sub cmdNext_Click()
- Dim x, ws As Worksheet, rng As Range, lr As Long
- Application.ScreenUpdating = False
- Set ws = ThisWorkbook.Worksheets("Sheet1")
- lr = ws.Cells(Rows.Count, 2).End(xlUp).Row
- Set rng = ws.Range("B1:B" & lr)
- x = Application.Match(TextBox1.Value, rng, 0)
- If Not IsError(x) Then
- Do
- x = x + 1
- If x = lr + 1 Then MsgBox "Last Record", vbExclamation: Exit Sub
- Loop Until ws.Cells(x, 2) <> ""
- TextBox1.Value = ws.Cells(x, 2)
- TextBox2.Value = ws.Cells(x, 3)
- If ws.Cells(x, 4) = "ذكر" Then OptionButton1.Value = True Else OptionButton2.Value = True
- End If
- Application.ScreenUpdating = True
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement