اذهب الي المحتوي
أوفيسنا
بحث مخصص من جوجل فى أوفيسنا
Custom Search

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

قام بنشر

جرب هذا الكود

Option Explicit

Private Sub Worksheet_Activate()
 data_val1
End Sub
'==================================
Private Sub ComboBox2_Change()
 ComboBox1.Clear
 Dim I%
 I = 4
 With Sheets("العقود")
 Do Until .Cells(I, "c") = vbNullString
  If .Cells(I, "c") = ComboBox2.Value Then
   ComboBox1.AddItem .Cells(I, "d")
  End If
  I = I + 1
 Loop
  End With
  
End Sub
'====================================
Sub data_val1()
Dim I%: I = 4
Dim arr
Dim rg As Object

Set rg = CreateObject("system.collections.arraylist")

With rg
 Do Until Sheets("العقود").Range("c" & I) = vbNullString
  If Not .contains(Sheets("العقود").Range("c" & I).Value) Then .Add Sheets("العقود").Range("c" & I).Value
 I = I + 1
 Loop
 .Sort
 arr = .toarray
End With

  Sheets("كشف عميل").OLEObjects("Combobox2").Object.List = Application.Transpose(arr)

End Sub

الملف مرفق

 

AouKoud_22.xlsm

  • Like 1
  • Thanks 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