मुख्य सामग्री पर जाएं

 ड्रॉप डाउन सूची कैसे बनाएं लेकिन एक्सेल में अलग-अलग मान कैसे दिखाएं?

लेखक: ज़ियाओयांग अंतिम संशोधित: 2022-07-25

एक्सेल वर्कशीट में, हम डेटा वैलिडेशन सुविधा के साथ जल्दी से एक ड्रॉप डाउन सूची बना सकते हैं, लेकिन, क्या आपने कभी ड्रॉप डाउन सूची पर क्लिक करते समय एक अलग मूल्य दिखाने की कोशिश की है? उदाहरण के लिए, मेरे पास कॉलम ए और कॉलम बी में निम्नलिखित दो कॉलम डेटा हैं, अब, मुझे नाम कॉलम में मानों के साथ एक ड्रॉप डाउन सूची बनाने की आवश्यकता है, लेकिन, जब मैं बनाई गई ड्रॉप डाउन सूची से नाम का चयन करता हूं, तो संबंधित संख्या कॉलम में मान निम्न स्क्रीनशॉट में दिखाए गए अनुसार प्रदर्शित होता है। यह आलेख इस कार्य को हल करने के लिए विवरण पेश करेगा।

दस्तावेज़ ड्रॉपडाउन विभिन्न मान 1

ड्रॉप डाउन सूची बनाएं लेकिन ड्रॉप डाउन सूची सेल में भिन्न मान दिखाएं


ड्रॉप डाउन सूची बनाएं लेकिन ड्रॉप डाउन सूची सेल में भिन्न मान दिखाएं

इस कार्य को पूरा करने के लिए कृपया निम्नलिखित चरण दर चरण कार्य करें:

1. ड्रॉप डाउन सूची में आप जिन सेल मानों का उपयोग करना चाहते हैं उनके लिए एक श्रेणी नाम बनाएं, इस उदाहरण में, मैं ड्रॉपडाउन में नाम दर्ज करूंगा नाम बॉक्स, और उसके बाद दबाएँ दर्ज कुंजी, स्क्रीनशॉट देखें:

दस्तावेज़ ड्रॉपडाउन विभिन्न मान 2

2. फिर उन कक्षों का चयन करें जहां आप ड्रॉप डाउन सूची सम्मिलित करना चाहते हैं, और क्लिक करें जानकारी > डेटा मान्यता > डेटा मान्यता, स्क्रीनशॉट देखें:

दस्तावेज़ ड्रॉपडाउन विभिन्न मान 3

3. में डेटा मान्यता डायलॉग बॉक्स, के अंतर्गत सेटिंग टैब चुनें सूची से अनुमति देना नीचे छोड़ें, और फिर क्लिक करें दस्तावेज़ ड्रॉपडाउन विभिन्न मान 5 नाम सूची का चयन करने के लिए बटन जिसे आप ड्रॉप डाउन मान के रूप में उपयोग करना चाहते हैं स्रोत पाठ बॉक्स। स्क्रीनशॉट देखें:

दस्तावेज़ ड्रॉपडाउन विभिन्न मान 4

4. ड्रॉप डाउन सूची डालने के बाद, कृपया सक्रिय शीट टैब पर राइट क्लिक करें और चयन करें कोड देखें संदर्भ मेनू से, और खुले में अनुप्रयोगों के लिए माइक्रोसॉफ्ट विज़ुअल बेसिक विंडो, निम्न कोड को कॉपी करें और रिक्त मॉड्यूल में पेस्ट करें:

VBA कोड: ड्रॉप डाउन सूची से भिन्न मान प्रदर्शित करें:

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
    selectedNa = Target.Value
    If Target.Column = 5 Then
        selectedNum = Application.VLookup(selectedNa, ActiveSheet.Range("dropdown"), 2, False)
        If Not IsError(selectedNum) Then
            Target.Value = selectedNum
        End If
    End If
End Sub

दस्तावेज़ ड्रॉपडाउन विभिन्न मान 6

नोट: उपरोक्त कोड में, संख्या 5 अंदर यदि लक्ष्य। कॉलम = 5 तो स्क्रिप्ट वह कॉलम नंबर है जो आपकी ड्रॉप डाउन सूची में स्थित है, "ड्रॉप डाउन" इस में चयनितनम = एप्लिकेशन.वीलुकअप(चयनितना, एक्टिवशीट.रेंज("ड्रॉपडाउन"), 2, गलत) कोड वह श्रेणी नाम है जिसे आपने चरण 1 में बनाया है। आप उन्हें अपनी आवश्यकता के अनुसार बदल सकते हैं।

5. फिर इस कोड को सहेजें और बंद करें, अब, जब आप ड्रॉप डाउन सूची से कोई आइटम चुनते हैं, तो उसी सेल में एक सापेक्ष भिन्न मान प्रदर्शित होता है, स्क्रीनशॉट देखें:

दस्तावेज़ ड्रॉपडाउन विभिन्न मान 7


डेमो: ड्रॉप डाउन सूची बनाएं लेकिन एक्सेल में अलग-अलग मान दिखाएं

एक्सेल के लिए कुटूल: 300 से अधिक उपयोगी एक्सेल ऐड-इन्स के साथ, 30 दिनों में बिना किसी सीमा के आज़माने के लिए निःशुल्क। अभी डाउनलोड करें और निःशुल्क परीक्षण करें!

 

सर्वोत्तम कार्यालय उत्पादकता उपकरण

🤖 कुटूल्स एआई सहयोगी: निम्न के आधार पर डेटा विश्लेषण में क्रांति लाएं: बुद्धिमान निष्पादन   |  कोड जनरेट करें  |  कस्टम फ़ॉर्मूले बनाएं  |  डेटा का विश्लेषण करें और चार्ट बनाएं  |  कुटूल फ़ंक्शंस का आह्वान करें...
लोकप्रिय सुविधाएँ: डुप्लिकेट ढूंढें, हाइलाइट करें या पहचानें   |  रिक्त पंक्तियाँ हटाएँ   |  डेटा खोए बिना कॉलम या सेल को संयोजित करें   |   फॉर्मूला के बिना गोल ...
सुपर लुकअप: एकाधिक मानदंड VLookup    मल्टीपल वैल्यू वीलुकअप  |   अनेक शीटों में VLookup   |   फजी लुकअप ....
उन्नत ड्रॉप-डाउन सूची: शीघ्रता से ड्रॉप डाउन सूची बनाएं   |  आश्रित ड्रॉप डाउन सूची   |  बहु-चयन ड्रॉप डाउन सूची ....
स्तम्भ प्रबंधक: कॉलमों की एक विशिष्ट संख्या जोड़ें  |  कॉलम ले जाएँ  |  छिपे हुए कॉलम की दृश्यता स्थिति टॉगल करें  |  रेंज और कॉलम की तुलना करें ...
फीचर्ड फीचर्स: ग्रिड फोकस   |  डिजाइन देखें   |   बड़ा फॉर्मूला बार    कार्यपुस्तिका एवं शीट प्रबंधक   |  संसाधन लाइब्रेरी (ऑटो टेक्स्ट)   |  खजूर बीनने वाला   |  कार्यपत्रकों को संयोजित करें   |  एन्क्रिप्ट/डिक्रिप्ट सेल    सूची के अनुसार ईमेल भेजें   |  सुपर फ़िल्टर   |   विशेष फ़िल्टर (फ़िल्टर बोल्ड/इटैलिक/स्ट्राइकथ्रू...) ...
शीर्ष 15 टूलसेट12 टेक्स्ट टूल्स (पाठ जोड़ें, अक्षर हटाएँ, ...)   |   50 + चार्ट प्रकार (गैन्ट चार्ट, ...)   |   40+ प्रैक्टिकल सूत्र (जन्मदिन के आधार पर आयु की गणना करें, ...)   |   19 निवेशन टूल्स (QR कोड डालें, पथ से चित्र सम्मिलित करें, ...)   |   12 रूपांतरण टूल्स (शब्दों को संख्याएँ, मुद्रा रूपांतरण, ...)   |   7 विलय और विभाजन टूल्स (उन्नत संयोजन पंक्तियाँ, विभाजन कोशिकाओं, ...)   |   ... और अधिक

एक्सेल के लिए कुटूल के साथ अपने एक्सेल कौशल को सुपरचार्ज करें, और पहले जैसी दक्षता का अनुभव करें। एक्सेल के लिए कुटूल उत्पादकता बढ़ाने और समय बचाने के लिए 300 से अधिक उन्नत सुविधाएँ प्रदान करता है।  वह सुविधा प्राप्त करने के लिए यहां क्लिक करें जिसकी आपको सबसे अधिक आवश्यकता है...

Description


ऑफिस टैब ऑफिस में टैब्ड इंटरफ़ेस लाता है, और आपके काम को बहुत आसान बनाता है

  • Word, Excel, PowerPoint में टैब्ड संपादन और रीडिंग सक्षम करें, प्रकाशक, एक्सेस, विसियो और प्रोजेक्ट।
  • नई विंडो के बजाय एक ही विंडो के नए टैब में एकाधिक दस्तावेज़ खोलें और बनाएं।
  • आपकी उत्पादकता 50% बढ़ जाती है, और आपके लिए हर दिन सैकड़ों माउस क्लिक कम हो जाते हैं!

 

Comments (44)
No ratings yet. Be the first to rate!
This comment was minimized by the moderator on the site
Hello everyone,

About two years ago, @skyyang posted the following formula, which works perfectly:
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
Dim xRg As Range
selectedNa = Target.Value
If Target.Column = 5 Then
Set xRg = ActiveWorkbook.Names("DropDown").RefersToRange
selectedNum = Application.VLookup(selectedNa, xRg, 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
End If
End If
End Sub


However, I have six sections each needing the same results from the DDL name range. How do I get this formula to apply to more than one column please?

Any help would be greatly appreciated 🙂
This comment was minimized by the moderator on the site
How can I use this formula if the data for the drop down is on a sheet named materials?

Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
selectedNa = Target.Value
If Target.Column = 4 Then
selectedNum = Application.VLookup(selectedNa, ActiveSheet.Range("Material_List"), 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
End If
End If
End Sub
This comment was minimized by the moderator on the site
Can this be applied to certain cells only instead of the whole column? It’s coming back as #N/A for some areas that i don't need this formula for. Thanks
This comment was minimized by the moderator on the site
The code I have used is below:


Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
selectedNa = Target.Value
If Target.Column = 8 Then
selectedNum = Application.VLookup(selectedNa, ActiveSheet.Range("codes"), 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
End If
End If
End Sub



This works exactly how I need it too, however, when I save, close and then re-open the excel document, this has disappeared from the 'View Code' window and I have to re-insert the code again?????

Please help!
This comment was minimized by the moderator on the site
I have even saved the document as a Excel Macro-Enabled Workbook
This comment was minimized by the moderator on the site
Can you do multiple drop down lists like this on the same worksheet tab? How will the vba code be adjusted to accommodate different lists for the sheet?
This comment was minimized by the moderator on the site
Is there a way to return multiple selections to the same field? I.E. I want to show the numbers for Tedi, Dave and Lucy on a single field seperated by a comma.Many thanks.
This comment was minimized by the moderator on the site
This works for me but is there a way to allow multiple selections in the same cell? I.e. I wanted to return the numbers for Tedi, Lucy and Dave in a single field seperated by a comma?
This comment was minimized by the moderator on the site
Can this be done on different sheets? I mean, on sheet1 the range and on sheet2 the dropdown. How do I have to code this? Thanks.
This comment was minimized by the moderator on the site
Hello, Muhammd,To apply the drop down list in different worksheet, the following code may help you:Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
Dim xRg As Range
selectedNa = Target.Value
If Target.Column = 5 Then
Set xRg = ActiveWorkbook.Names("DropDown").RefersToRange
selectedNum = Application.VLookup(selectedNa, xRg, 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
End If
End If
End Sub


Please try, thank you!
This comment was minimized by the moderator on the site
trying to do multiple drop downs sheet 1 , returning different worksheet. Is this possible as when i select in separate dropdown the sam numbers it does not work For example
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice

selectedNa = Target.Value
If Target.Column = 2 Then
Set xRg = ActiveWorkbook.Names("Supervisors").RefersToRange
selectedNum = Application.VLookup(selectedNa, xRg, 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
selectedNa = Target.Value
End If
End If
selectedNa = Target.Value
If Target.Column = 9 Then
Set xRg = ActiveWorkbook.Names("Earth").RefersToRange
selectedNum = Application.VLookup(selectedNa, xRg, 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
selectedNa = Target.Value

End If
End If
End Sub
This comment was minimized by the moderator on the site
Good morning i hope someone can help me.I used the VBA code above and it worked perfectly giving me my drop down showing me Different Values In Drop Down List Cell.My problem is that I need a second drop down list showing different values in a second list cell, on the same sheet, can anyone help me in doing this Kind Regards Rene
This comment was minimized by the moderator on the site
Se pueden usar diferentes “dropdown” en la misma hoja, para diferentes columnas y con diferentes rangos?Me explico, tengo una hoja en la que los usuarios introducen diferentes datos. En dos columnas 5 y 12 necesito validar la entrada con respecto a dos rangos diferentes de datos. Lo he probado solo con una columna y funciona perfectamente, pero no encuentro la manera de modificar el código VBA para la segunda columna
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