اذهب الي المحتوي
أوفيسنا

تعديل كود فى فورم اكسيل


Elhacker
إذهب إلى أفضل إجابة Solved by عبدالفتاح في بي اكسيل,

الردود الموصى بها

السلام عليكم 

اريد التعديل على كود الفورم هذه ليظهر فى قائمة البحث textbox 1 اربع اعمدة بدلا من عمودين 

الكود

Private Sub TxtSearch_Change()
Dim x As Long
Me.TxtSearch.Text = StrConv(Me.TxtSearch.Text, vbProperCase)
Me.ListBox1.Clear
For x = 2 To Application.WorksheetFunction.CountA(Sheet1.Range("A:A"))
a = Len(Me.TxtSearch.Text)
If Left(Sheet1.Cells(x, 1).Value, a) = Left(Me.TxtSearch.Text, a) Then
Me.ListBox1.AddItem Sheet1.Cells(x, 1).Value
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = Sheet1.Cells(x, 2).Value
End If
Next x
End Sub

وهناك مرفق صورة 

 

 

 

1.jpg

ADVANCED SEARSH.xlsm

رابط هذا التعليق
شارك

  • أفضل إجابة
اقتباس

اريد التعديل على كود الفورم هذه ليظهر فى قائمة البحث textbox 1 اربع اعمدة بدلا من عمودين 

 

Private Sub TxtSearch_Change()
Dim x As Long
Me.TxtSearch.Text = StrConv(Me.TxtSearch.Text, vbProperCase)
Me.ListBox1.Clear
For x = 4 To Application.WorksheetFunction.CountA(Sheet1.Range("A:A"))
a = Len(Me.TxtSearch.Text)
If Left(Sheet1.Cells(x, 1).Value, a) = Left(Me.TxtSearch.Text, a) Then
Me.ListBox1.AddItem Sheet1.Cells(x, 1).Value
Me.ListBox1.List(ListBox1.ListCount - 1, 1) = Sheet1.Cells(x, 2).Value
Me.ListBox1.List(ListBox1.ListCount - 1, 2) = Sheet1.Cells(x, 3).Value
Me.ListBox1.List(ListBox1.ListCount - 1, 3) = Sheet1.Cells(x, 4).Value
End If
Next x
End Sub

 

 

 

ADVANCED SEARSH.xlsm

  • Like 1
رابط هذا التعليق
شارك

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

زائر
اضف رد علي هذا الموضوع....

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • تصفح هذا الموضوع مؤخراً   0 اعضاء متواجدين الان

    • لايوجد اعضاء مسجلون يتصفحون هذه الصفحه
×
×
  • اضف...

Important Information