انتقل إلى المحتوى الرئيسي

كيفية الإكمال التلقائي عند الكتابة في قائمة Excel المنسدلة؟

للحصول على قائمة منسدلة للتحقق من صحة البيانات تحتوي على العديد من العناصر ، تحتاج إلى التمرير لأعلى ولأسفل في القائمة للعثور على العنصر الذي تحتاجه أو كتابة الكلمة بأكملها في مربع القائمة بشكل صحيح. هل هناك أي طريقة لجعل القائمة المنسدلة تكتمل تلقائيًا عند كتابة الأحرف المقابلة؟ سيساعد هذا الأشخاص على العمل بكفاءة أكبر في أوراق العمل مع القوائم المنسدلة في الخلايا. يوفر هذا البرنامج التعليمي طريقتين لمساعدتك في تحقيق ذلك.

جعل القوائم المنسدلة تكتمل تلقائيًا باستخدام كود فبا
يمكنك بسهولة إكمال القوائم المنسدلة تلقائيًا في ثانيتين

المزيد من البرامج التعليمية للقائمة المنسدلة ...


جعل القوائم المنسدلة تكتمل تلقائيًا باستخدام كود فبا

يرجى القيام بما يلي لإكمال القائمة المنسدلة تلقائيًا بعد كتابة الأحرف المقابلة في الخلية.

أولاً ، تحتاج إلى إدراج مربع تحرير وسرد في ورقة العمل وتغيير خصائصه.

1. افتح ورقة العمل التي تحتوي على خلايا القائمة المنسدلة التي تريد إكمالها تلقائيًا.

2. قبل إدراج مربع التحرير والسرد ، تحتاج إلى إضافة علامة التبويب Developer إلى شريط Excel. إذا كانت علامة التبويب المطور تظهر على الشريط الخاص بك ، انتقل إلى الخطوة 3. بخلاف ذلك ، قم بما يلي لإظهار علامة التبويب Develper في الشريط: انقر فوق قم بتقديم > مزيد من الخيارات لفتح مزيد من الخيارات نافذة او شباك. في هذا خيارات إكسيل الإطار، انقر فوق تخصيص الشريط في الجزء الأيمن ، تحقق من المطور مربع ، ثم انقر فوق OK زر. انظر لقطة الشاشة:

3. انقر المطور > إدراج > صندوق التحرير والسرد (عنصر تحكم ActiveX).

4. ارسم مربع تحرير وسرد في ورقة العمل الحالية. انقر بزر الماوس الأيمن فوقه ثم حدد عقارات من قائمة النقر بزر الماوس الأيمن.

5. في ال عقارات في مربع الحوار ، يرجى استبدال النص الأصلي بتنسيق (اسم) المجال مع TempCombo.

6. إيقاف تشغيل وضع التصميم بالضغط المطور > وضع التصميم.

بعد ذلك ، قم بتطبيق رمز VBA أدناه

7. انقر بزر الماوس الأيمن فوق علامة تبويب الورقة الحالية وانقر فوق عرض الرمز من قائمة السياق. انظر لقطة الشاشة:

8. في الافتتاح ميكروسوفت فيسوال باسيك للتطبيقات نافذة ، يرجى نسخ ولصق رمز فبا أدناه في نافذة كود ورقة العمل.

كود فبا: الإكمال التلقائي عند الكتابة في القائمة المنسدلة

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update by Extendoffice: 2020/01/16
    Dim xCombox As OLEObject
    Dim xStr As String
    Dim xWs As Worksheet
    Dim xArr
    
    Set xWs = Application.ActiveSheet
    On Error Resume Next
    Set xCombox = xWs.OLEObjects("TempCombo")
    With xCombox
        .ListFillRange = ""
        .LinkedCell = ""
        .Visible = False
    End With
    If Target.Validation.Type = 3 Then
        Target.Validation.InCellDropdown = False
        Cancel = True
        xStr = Target.Validation.Formula1
        xStr = Right(xStr, Len(xStr) - 1)
        If xStr = "" Then Exit Sub
        With xCombox
            .Visible = True
            .Left = Target.Left
            .Top = Target.Top
            .Width = Target.Width + 5
            .Height = Target.Height + 5
            .ListFillRange = xStr
            If .ListFillRange = "" Then
                xArr = Split(xStr, ",")
                Me.TempCombo.List = xArr
            End If
            .LinkedCell = Target.Address
        End With
        xCombox.Activate
        Me.TempCombo.DropDown
    End If
End Sub
Private Sub TempCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Select Case KeyCode
        Case 9
            Application.ActiveCell.Offset(0, 1).Activate
        Case 13
            Application.ActiveCell.Offset(1, 0).Activate
    End Select
End Sub

9. صحافة قديم + Q مفاتيح في نفس الوقت لإغلاق تطبيقات Microsoft Visual Basic نافذة.

من الآن فصاعدًا ، عند النقر فوق خلية قائمة منسدلة ، ستظهر مطالبة القائمة المنسدلة تلقائيًا. يمكنك البدء في كتابة الحرف لإكمال العنصر المقابل تلقائيًا في الخلية المحددة. انظر لقطة الشاشة:

ملحوظة: هذا الرمز لا يعمل مع الخلايا المدمجة.


يمكنك بسهولة إكمال القائمة المنسدلة تلقائيًا في ثانيتين

بالنسبة لمعظم مستخدمي Excel ، يصعب إتقان طريقة VBA أعلاه. ولكن مع قائمة منسدلة قابلة للبحث سمة من سمات كوتولس ل إكسيل، يمكنك بسهولة تمكين الإكمال التلقائي للقوائم المنسدلة للتحقق من صحة البيانات بتنسيق مجموعةأطلقت حملة ورقة العمل الحاليةأطلقت حملة المصنف الحالي or ورقة عمل محددة كما تحتاج في ثانيتين فقط. علاوة على ذلك ، تتوفر هذه الميزة لجميع إصدارات Excel.

معلومه- سرية: قبل تطبيق هذه الأداة ، يرجى التثبيت كوتولس ل إكسيل أولا. انتقل إلى التنزيل المجاني الآن.

  1. أختار كوتولس > قائمة منسدلة > قائمة منسدلة قابلة للبحث.
  2. في مجلة قائمة منسدلة قابلة للبحث في مربع الحوار ، حدد المكان الذي تريد تطبيق هذه الميزة فيه في ملف حدد النطاق ، ثم انقر فوق OK لحفظ الإعدادات.
نتيجة

بمجرد التهيئة ، سيؤدي النقر فوق خلية قائمة منسدلة داخل النطاق المحدد إلى إظهار مربع قائمة. عند كتابة الأحرف ، بمجرد تطابق عنصر واحد تمامًا ، سيتم إكمال الكلمة بالكامل تلقائيًا.

ملاحظات: لتطبيق هذه الميزة من فضلك قم بتنزيل وتثبيت Kutools لبرنامج Excel لأول مرة.

مقالات ذات صلة:

كيفية إنشاء قائمة منسدلة مع مربعات اختيار متعددة في إكسيل؟
يميل العديد من مستخدمي Excel إلى إنشاء قائمة منسدلة مع مربعات اختيار متعددة من أجل تحديد عناصر متعددة من القائمة في كل مرة. في الواقع ، لا يمكنك إنشاء قائمة بمربعات اختيار متعددة باستخدام التحقق من صحة البيانات. في هذا البرنامج التعليمي ، سوف نعرض لك طريقتين لإنشاء قائمة منسدلة مع مربعات اختيار متعددة في Excel. يوفر هذا البرنامج التعليمي طريقة حل المشكلة.

قم بإنشاء قائمة منسدلة من مصنف آخر في Excel
من السهل جدًا إنشاء قائمة منسدلة للتحقق من صحة البيانات بين أوراق العمل داخل المصنف. ولكن إذا كانت بيانات القائمة التي تحتاجها للتحقق من صحة البيانات موجودة في مصنف آخر ، فماذا ستفعل؟ في هذا البرنامج التعليمي ، ستتعلم كيفية إنشاء قائمة منسدلة من مصنف آخر في Excel بالتفصيل.

قم بإنشاء قائمة منسدلة قابلة للبحث في Excel
بالنسبة للقائمة المنسدلة ذات القيم المتعددة ، فإن العثور على قائمة مناسبة ليس بالأمر السهل. قدمنا ​​سابقًا طريقة قائمة منسدلة للإكمال التلقائي عند إدخال الحرف الأول في المربع المنسدل. إلى جانب وظيفة الإكمال التلقائي ، يمكنك أيضًا جعل القائمة المنسدلة قابلة للبحث لتحسين كفاءة العمل في العثور على القيم المناسبة في القائمة المنسدلة. لجعل القائمة المنسدلة قابلة للبحث ، جرب الطريقة الموجودة في هذا البرنامج التعليمي.

ملء الخلايا الأخرى تلقائيًا عند تحديد القيم في القائمة المنسدلة في Excel
لنفترض أنك قمت بإنشاء قائمة منسدلة بناءً على القيم الموجودة في نطاق الخلايا B8: B14. عند تحديد أي قيمة في القائمة المنسدلة ، فأنت تريد ملء القيم المقابلة في نطاق الخلايا C8: C14 تلقائيًا في خلية محددة. لحل المشكلة ، ستفيدك الطرق الموجودة في هذا البرنامج التعليمي.

المزيد من البرامج التعليمية للقائمة المنسدلة ...

أفضل أدوات إنتاجية المكتب

🤖 مساعد Kutools AI: إحداث ثورة في تحليل البيانات على أساس: التنفيذ الذكي   |  إنشاء التعليمات البرمجية  |  إنشاء صيغ مخصصة  |  تحليل البيانات وإنشاء الرسوم البيانية  |  استدعاء وظائف Kutools...
الميزات الشعبية: البحث عن التكرارات أو تمييزها أو تحديدها   |  حذف الصفوف الفارغة   |  دمج الأعمدة أو الخلايا دون فقدان البيانات   |   جولة بدون صيغة 
سوبر بحث: معايير متعددة VLookup    VLookup ذات القيمة المتعددة  |   VLookup عبر أوراق متعددة   |   بحث غامض ....
قائمة منسدلة متقدمة: إنشاء القائمة المنسدلة بسرعة   |  القائمة المنسدلة التابعة   |  قائمة منسدلة متعددة التحديد ....
مدير العمود: إضافة عدد محدد من الأعمدة  |  نقل الأعمدة  |  تبديل حالة رؤية الأعمدة المخفية  |  مقارنة النطاقات والأعمدة 
الميزات المميزة: التركيز على الشبكة   |  عرض تصميم   |   شريط الفورمولا الكبير    مدير المصنفات والأوراق   |  مكتبة الموارد (النص السيارات)   |  منتقي التاريخ   |  اجمع أوراق العمل   |  تشفير/فك تشفير الخلايا    إرسال رسائل البريد الإلكتروني عن طريق القائمة   |  سوبر تصفية   |   مرشح خاص (تصفية غامق / مائل / يتوسطه خط ...) ...
أفضل 15 مجموعة أدوات12 نص الأدوات (إضافة نص, إزالة الأحرف، ...)   |   +50 رسم الأنواع (مخطط جانت، ...)   |   40+ عملي الصيغ (احسب العمر على أساس تاريخ الميلاد، ...)   |   19 إدخال الأدوات (أدخل رمز الاستجابة السريعة, إدراج صورة من المسار، ...)   |   12 تحويل الأدوات (أرقام إلى كلمات, نتيجة تحويل عملة، ...)   |   7 دمج وتقسيم الأدوات (الجمع بين الصفوف المتقدمة, تقسيم الخلايا، ...)   |   ... و اكثر

عزز مهاراتك في Excel باستخدام Kutools for Excel، واختبر كفاءة لم يسبق لها مثيل. يقدم Kutools for Excel أكثر من 300 ميزة متقدمة لتعزيز الإنتاجية وتوفير الوقت.  انقر هنا للحصول على الميزة التي تحتاجها أكثر...

الوصف


يجلب Office Tab الواجهة المبوبة إلى Office ، ويجعل عملك أسهل بكثير

  • تمكين التحرير والقراءة المبوبة في Word و Excel و PowerPointوالناشر والوصول و Visio والمشروع.
  • فتح وإنشاء مستندات متعددة في علامات تبويب جديدة من نفس النافذة ، بدلاً من النوافذ الجديدة.
  • يزيد من إنتاجيتك بنسبة 50٪ ، ويقلل مئات النقرات بالماوس كل يوم!
Comments (325)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hi, many thanks for this material. It helped a lot.
This comment was minimized by the moderator on the site
Hello,

following on from my last comment:

I'm setting up 'standard' rows with the dropdown lists in them. These I'm wanting to copy below into an extensive spreadsheet.
Unfortunately the dropdown's don't copy down when I do that after using the VBA.
Is there a way to do whats described above?

Cheers,
Catherine
This comment was minimized by the moderator on the site
Hi Catherine,
The autocomplete drop-down lists generated by VBA code cannot be copied. You can only copy selected items that are displayed in the drop-down cell. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Hello,

Have implemented this successfully, so thank you for this page and code.
But now I have an associated problem...:

After doing all of the above points, the code works as described, but I cannot do any undo/redo actions in the entire spreadsheet.
Is there a way to turn this combo box on for when I want to work with the dropdowns and off for when I want to work in other cells? so that the undo/redo actions are possible again?
and note, yes I have turned the design mode off after doing the above steps, but it still doesn't help the problem.

Cheers,
Catherine
This comment was minimized by the moderator on the site
Hi Catherine Foley,
If you want to use the undo operation on cells other than the drop-down cells, the following VBA code can help you. Please give it a try.
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update by Extendoffice: 2022/09/22
    Dim xCombox As OLEObject
    Dim xStr As String
    Dim xWs As Worksheet
    Dim xArr
    
    On Error Resume Next

    Set xWs = Application.ActiveSheet
    
    Set xCombox = xWs.OLEObjects("TempCombo")
    If Target.Validation.Type <> 3 Then
        If xCombox.Visible Then
            xCombox.Visible = False
        End If
        Exit Sub
    End If
    
    With xCombox
        .ListFillRange = ""
        .LinkedCell = ""
'        .Visible = False
    End With

    Target.Validation.InCellDropdown = False
    Cancel = True
    xStr = Target.Validation.Formula1
    xStr = Right(xStr, Len(xStr) - 1)
    If xStr = "" Then Exit Sub
    With xCombox
        .Visible = True
        .Left = Target.Left
        .Top = Target.Top
        .Width = Target.Width + 5
        .Height = Target.Height + 5
        .ListFillRange = xStr
        If .ListFillRange = "" Then
            xArr = Split(xStr, ",")
            Me.TempCombo.List = xArr
        End If
        .LinkedCell = Target.Address
    End With
    xCombox.Activate
    Me.TempCombo.DropDown

End Sub
Private Sub TempCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
    Select Case KeyCode
        Case 9
            Application.ActiveCell.Offset(0, 1).Activate
        Case 13
            Application.ActiveCell.Offset(1, 0).Activate
    End Select
End Sub
This comment was minimized by the moderator on the site
I hope now it will be upload
This comment was minimized by the moderator on the site
This code works really well for a single drop down. However, if I have 5 dropdowns using the same list of values but they need to operate independently of each other how is that accomplished? Despite my best efforts, if I put more than one combo box on the page, any selection is one is mirrored in the other.
This comment was minimized by the moderator on the site
Hi Mbuchmeier,Only need one combo box on the page. The code works on all drop-down lists in current page. You just need to manually click on the drop-down list cell to activate the combo box.
This comment was minimized by the moderator on the site
Hi crystal,
I am working with the combo box (The VBA code from 2021/11/05). It is working great and very useful but there are 2 issues:1. Issue #1: Usually when you work on any cell in Excel, there is indication on the row number which indicate which row you work about. When the combo box is opened this indication is missing2.  Issue #2: When the combo box is opened in the last column of the dynamic table, then it isn't  working as usual: when I select value from the list, the cell remain empty until I move the cursor to another cell
Attached screenshot.
Thank in advance
This comment was minimized by the moderator on the site
Hi Yoni,Thanks for your feedback. For the issues you mentioned:1. Issue #1: Excel does not highlight the row number when selecting an object in the worksheet. Since we use a combo box to replace the data validation drop-down list to handle the autocomplete operation, we can't show the indication in this case;2. Issue #2: I have tried as you described, but the problem cannot be reproduced. The screenshot you attached does not display, you need to save the screenshot and uplode it via the "Upload files" button below.
This comment was minimized by the moderator on the site
Hi Crystal,Thanks a lot for your response. Attached the screenshot. hope it will work now
This comment was minimized by the moderator on the site
Hi Yoni,Sorry for the inconvenience. The screenshot you uploaded is still not shown on the page. You need to save the screenshot on your disk in advance and then uplode it via the "Upload files" button. See the attached screenshot.
This comment was minimized by the moderator on the site
will, thank you is not enugh :::: alot of thank you then ;;;;; that worked like magic :)
This comment was minimized by the moderator on the site
Yeah, basically completely useless.  Want the cell to auto-complete when typing in a cell using list data validation.Tried this, and now I have to start over from scratch because I can't Undo it.  Thanks.Also loaded with syntax errors.
This comment was minimized by the moderator on the site
It works as it should be except for two things, first, there is no validation after insertion. i.e. if I typed anything at the combo then clicked enter it will accept the typed value while it should not do this since the data validation is being used to prevent such behaviors and make sure that the entered data is from selected range. Second, at the data validation list, sometimes I use big range with empty cells and select ignore empty at validation list but the combo takes all the range and shows it, will be nice to remove the empty cells from the combo range.
Thanks & hope you can implement these things to make it perfect.
This comment was minimized by the moderator on the site
Hi, AhmedThe VBA below helps to solve the problem of blank cells. Since the Combo box accepts the value that are not in the list, we still can't find a way to solve this problem. Sorry for the inconvenience.
<div data-tag="code">Private Sub Worksheet_SelectionChange(ByVal Target As Range)
'Update by Extendoffice: 2021/11/05
Dim xCombox As OLEObject
Dim xStr As String
Dim xWs As Worksheet
Dim xArr, xArr1
Dim xRg As Range
Dim xSrc As Variant
Dim xI, xJ, xIndex, xCount As Integer

Set xWs = Application.ActiveSheet
On Error Resume Next
Set xCombox = xWs.OLEObjects("TempCombo")
With xCombox
.ListFillRange = ""
.LinkedCell = ""
.Visible = False
End With
If Target.Validation.Type = 3 Then
Target.Validation.InCellDropdown = False
Cancel = True
xStr = Target.Validation.Formula1
xStr = Right(xStr, Len(xStr) - 1)
If xStr = "" Then Exit Sub
Set xRg = Range(xStr)
If xRg Is Nothing Then
xArr1 = Split(xStr, ",")
Else
ReDim xArr1(0 To xRg.Count - 1)
For xI = 0 To xRg.Count - 1
xArr1(xI) = xRg.Item(xI + 1).Value
Next
End If
xI = 0
xCount = UBound(xArr1) + 1
For xJ = 0 To UBound(xArr1)
If Replace(xArr1(xJ), " ", "") = "" Then xCount = xCount - 1
Next
ReDim xArr(0 To xCount - 1)
xIndex = 0
For xJ = 0 To UBound(xArr1)
If Replace(xArr1(xJ), " ", "") <> "" Then
xArr(xIndex) = xArr1(xJ)
xIndex = xIndex + 1
End If
Next
xStr = ""
With xCombox
.Visible = True
.Left = Target.Left
.Top = Target.Top
.Width = Target.Width + 5
.Height = Target.Height + 5
.ListFillRange = xStr
If .ListFillRange = "" Then
'xArr = Split(xStr, ",")
Me.TempCombo.List = xArr
End If
.LinkedCell = Target.Address
End With
xCombox.Activate
Me.TempCombo.DropDown
End If
End Sub
Private Sub TempCombo_KeyDown(ByVal KeyCode As MSForms.ReturnInteger, ByVal Shift As Integer)
Select Case KeyCode
Case 9
Application.ActiveCell.Offset(0, 1).Activate
Case 13
Application.ActiveCell.Offset(1, 0).Activate
End Select
End Sub
This comment was minimized by the moderator on the site
Hi Crystal,
I am working with the combo box (The VBA code from 2021/11/05). It is working great and so useful! thanks a lot.
I found the source of my problem. There was a line of freeze panes which override the combo box.
The only problem now is that the Undo is not working. Any idea?
Thanks in advanced,
Yoni
This comment was minimized by the moderator on the site
Hi,
The code does not support Undo. Sorry for the inconvenience.
This comment was minimized by the moderator on the site
Thanks. Maybe do you know why Worksheet_Change event is not firing once I choose value from the combo box?
This comment was minimized by the moderator on the site
Hi, could you please doublecheck this code, when I use it instead of the dropdown list appearing, the source for the dropdown appears instead. This is the exact function I want, could you please fix it.
This comment was minimized by the moderator on the site
If you use a named range or something similar, like I have with a table column, it will display the named range name instead of the values in that named range. To get what you want, you need to change the xStr to display the worksheet range of that named range, since the .ListFillRange does not take in named ranges directly. This should accomplish it : dim RangeAddress as String: RangeAddress = Range(YourNamedRange).addressand then make the xStr something like this: xStr = "YourWorksheetNameWithTheNamedRangeInIt!" & RangeAddress (important: add the '!' for the sheet reference)
This will make your xStr look something like: NamedRangeSheet!$A$1:$A$5
xStr = Right(xStr, Len(xStr) - 1)

If .ListFillRange = "" Then
xArr = Split(xStr, ",")
Me.TempCombo.List = xArr
End If

with these adjustments your combobox should display the list values instead of the source
This comment was minimized by the moderator on the site
Hi Syu,Sorry I don't quite understand your description. Can you try to be more specific of it?After applying the VBA code mentioned in the above method, when the cell with the data validation drop-down list is checked, the drop-down list turn into a combo box, and then all the items in the list are listed. 
This comment was minimized by the moderator on the site
do you have an example file please?
This comment was minimized by the moderator on the site
Hello. The code is very cool. Please make sure that the formula "INDIRECT" is carried out and displayed. It is very necessary
This comment was minimized by the moderator on the site
The code is not working for a validation list which is created by vba code and the source is a named range
There are no comments posted here yet
Load More
Please leave your comments in English
Posting as Guest
×
Rate this post:
0   Characters
Suggested Locations