• Skip to main content
  • Skip to header right navigation
  • Skip to site footer

My Online Training Hub

Learn Dashboards, Excel, Power BI, Power Query, Power Pivot

  • Courses
  • Pricing
    • Free Courses
    • Power BI Course
    • Excel Power Query Course
    • Power Pivot and DAX Course
    • Excel Dashboard Course
    • Excel PivotTable Course – Quick Start
    • Advanced Excel Formulas Course
    • Excel Expert Advanced Excel Training
    • Excel Tables Course
    • Excel, Word, Outlook
    • Financial Modelling Course
    • Excel PivotTable Course
    • Excel for Customer Service Professionals
    • Excel for Operations Management Course
    • Excel for Decision Making Under Uncertainty Course
    • Excel for Finance Course
    • Excel Analysis ToolPak Course
    • Multi-User Pricing
  • Resources
    • Free Downloads
    • Excel Functions Explained
    • Excel Formulas
    • Excel Add-ins
    • IF Function
      • Excel IF Statement Explained
      • Excel IF AND OR Functions
      • IF Formula Builder
    • Time & Dates in Excel
      • Excel Date & Time
      • Calculating Time in Excel
      • Excel Time Calculation Tricks
      • Excel Date and Time Formatting
    • Excel Keyboard Shortcuts
    • Excel Custom Number Format Guide
    • Pivot Tables Guide
    • VLOOKUP Guide
    • ALT Codes
    • Excel VBA & Macros
    • Excel User Forms
    • VBA String Functions
  • Members
    • Login
    • Password Reset
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member

How to display different dropdown values with multiple columns in the same worksheet|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / How to display different dropdown values with multiple columns in the same worksheet|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search|Last Search Results
Search
Forum Scope




Match



Forum Options



Minimum search word length is 3 characters - maximum search word length is 84 characters
sp_Search Search
sp_RankInfo
Lost password?
sp_CrumbsHome HomeExcel ForumVBA & MacrosHow to display different dropdown v…
sp_PrintTopic sp_TopicIcon
How to display different dropdown values with multiple columns in the same worksheet
Avatar
Ahmet Yalcin

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
October 6, 2021
sp_UserOfflineSmall Offline
1
October 6, 2021 - 10:01 am
sp_Permalink sp_Print

Hello,

I found the below code that replaces the dropdown value with the second field of the "list" on the 6th coumn
However, I have another list for the 7th, 8th so on... column. Below code only works for 1 column in the worksheet. What code can I add to below code to make it work for multiple columns??
Thank you, in advance, for your help

Regards
Ahmet

-------------------------------------------------------------
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice
Dim xRg As Range
selectedNa = Target.Value
If Target.Column = 6 Then
Set xRg = ActiveWorkbook.Names("list1").RefersToRange
selectedNum = Application.VLookup(selectedNa, xRg, 2, False)
If Not IsError(selectedNum) Then
Target.Value = selectedNum
End If
End If
End Sub
--------------------------------------------------------------------

Avatar
Jessica Stewart
Northern USA
Member
Members


Trusted Members
Level 0
Forum Posts: 202
Member Since:
February 13, 2021
sp_UserOfflineSmall Offline
2
October 7, 2021 - 12:07 am
sp_Permalink sp_Print

Hi Ahmet! 

Currently your target.column is set to column 6, you would need to set your target.column to the columns you need. Is it possible for you to upload a demo of your spreadsheet with what you're looking to accomplish so I can take a look at it? I have ideas but I don't know if they would work without seeing what you need.

Avatar
Ahmet Yalcin

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
October 6, 2021
sp_UserOfflineSmall Offline
3
October 14, 2021 - 9:16 am
sp_Permalink sp_Print

Hello Jes,

Thank you for your kind return and I apologize for my late reply.

As seen in the attached sheet I am replacing dropdown value with a code.  However, I can only do it for 1 column

For example for gender when Man is chosen it returns 1.  Please kindly help how I can replace dropdown values of marital status and customer status with relevant values given in the Lists tab

Thank you

Avatar
Ahmet Yalcin

Active Member
Members
Level 0
Forum Posts: 3
Member Since:
October 6, 2021
sp_UserOfflineSmall Offline
4
October 18, 2021 - 6:03 pm
sp_Permalink sp_Print

Hello,

Will you be able to help me with my previous question?

Thank you

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Brian Pham, Chandler Davis, Valentyn Kristioglo
Guest(s) 8
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 870
Purfleet: 412
Frans Visser: 346
David_Ng: 306
lea cohen: 219
A.Maurizio: 202
Jessica Stewart: 202
Aye Mu: 201
jaryszek: 183
Newest Members:
drsven
Annie Witbrod
wahab tunde
Cong Le Duc
Faisal Bashir
Ivica Cvetkovski
Blaine Cox
Shankar Srinivasan
riyepa fdgf
Hannah Cave
Forum Stats:
Groups: 3
Forums: 24
Topics: 6205
Posts: 27212

 

Member Stats:
Guest Posters: 49
Members: 31880
Moderators: 3
Admins: 4
Administrators: Mynda Treacy, Philip Treacy, Catalin Bombea, FT
Moderators: MOTH Support, Velouria, Riny van Eekelen
© Simple:Press —sp_Information

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel PivotTables
  • Excel Shortcuts
  • Excel VBA
  • General Tips
  • Online Training
  • Outlook
  • Power Apps
  • Power Automate
  • Power BI
  • Power Pivot
  • Power Query
microsoft mvp logo
trustpilot excellent rating
Secured by Sucuri Badge
MyOnlineTrainingHub on YouTube Mynda Treacy on Linked In Mynda Treacy on Instagram Mynda Treacy on Twitter Mynda Treacy on Pinterest MyOnlineTrainingHub on Facebook
 

Company

  • About My Online Training Hub
  • Disclosure Statement
  • Frequently Asked Questions
  • Guarantee
  • Privacy Policy
  • Terms & Conditions
  • Testimonials
  • Become an Affiliate

Support

  • Contact
  • Forum
  • Helpdesk - For Technical Issues

Copyright © 2023 · My Online Training Hub · All Rights Reserved. Microsoft and the Microsoft Office logo are trademarks or registered trademarks of Microsoft Corporation in the United States and/or other countries. Product names, logos, brands, and other trademarks featured or referred to within this website are the property of their respective trademark holders.