اشرف السيد قام بنشر سبتمبر 10, 2014 قام بنشر سبتمبر 10, 2014 ماكرو بحث Sub Test() Dim sh As Worksheet Dim Lr As Long Dim i As Integer Dim Name As String, Clon As String Set sh = ThisWorkbook.Sheets("Sheet1") 1 Clon = InputBox(prompt:="اختيار عمود البحث.", _ Title:="اختيار عمود", Default:="اكتب اسم العمود الذي تريد البح فيه هنا") If Clon Like "[A-z]" Then Lr = sh.Cells(sh.Rows.Count, Clon).End(xlUp).Row GoTo 2 Else MsgBox " A-Z يجب ان تكون الحروف " GoTo 1 End If 2 Name = InputBox(prompt:="ادخل الاسم او الرقم ", _ Title:=" بحث حسب العمود المختار", Default:="اكتب الاسم او الرقم الذي تبحث عنه هنا") For i = 1 To Lr If sh.Range(Clon & i) = Name Then sh.Range(Clon & i).Select Exit For ElseIf i = Lr ThenMsgBox "الاسم الذي ادخلته غيرموجود" End If Next End Sub
الردود الموصى بها
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.