• 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
  • Blog
  • Excel Webinars
  • Excel Forum
    • Register as Forum Member
  • Login

Combobox v DropDown list|VBA & Macros|Excel Forum|My Online Training Hub

You are here: Home / Combobox v DropDown list|VBA & Macros|Excel Forum|My Online Training Hub
Avatar
sp_LogInOut Log In sp_Registration Register
sp_Search Search
Advanced Search
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 & MacrosCombobox v DropDown list
sp_PrintTopic sp_TopicIcon
Combobox v DropDown list
Avatar
Mel Smith

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 22, 2020
sp_UserOfflineSmall Offline
1
November 25, 2020 - 8:37 pm
sp_Permalink sp_Print

I use the following code, written by Philip Treacy, and it works very well.  My question is: now that my DropDown list has expanded, I would like to see more than the 8 rows that a DropDown list is limited to.  For this I need to use a ComboBox but I cannot make the ComboBox work with Philip's code.  Is there any way that this ban be achieved?

Mel

Philip's code is:

Sub DVChange(ByVal Target As Range, ByVal SheetDV As Range)

' Written by Philip Treacy
Dim OldVal As String
Dim NewVal As String
If Target.Count > 1 Then Exit Sub
If Not Intersect(Target, SheetDV) Is Nothing Then
Application.EnableEvents = False
NewVal = Target.Value
On Error Resume Next
Application.Undo
On Error GoTo 0
OldVal = Target.Value
If OldVal = "" Then
Target.Value = NewVal
Else
If NewVal = "" Then
Target.Value = ""
Else
If InStr(Target.Value, NewVal) = 0 Then
Target.Value = OldVal & ", " & NewVal
End If
End If
End If
Application.EnableEvents = True
Else
Exit Sub
End If
End Sub

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1845
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
2
November 29, 2020 - 3:42 am
sp_Permalink sp_Print

Hi Mel,

Why are you saying that a dropdown is limited to 8 rows?

Please prepare a sample file that works with the code, we cannot recreate and test what you are saying.

Avatar
Mel Smith

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 22, 2020
sp_UserOfflineSmall Offline
3
November 29, 2020 - 8:49 pm
sp_Permalink sp_Print

What I meant by 8 rows is that only 8 rows of the DropDown list is visible whereas in a ComboBox one can set this to, say, 24 etc.

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1845
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
4
November 30, 2020 - 12:32 am
sp_Permalink sp_Print

Can you provide the sample file?

Avatar
Mel Smith

Active Member
Members
Level 0
Forum Posts: 5
Member Since:
February 22, 2020
sp_UserOfflineSmall Offline
5
November 30, 2020 - 8:52 pm
sp_Permalink sp_Print

As you can see from my first post, all I want to do is use a ComboBox instead of the DropDown because the list within the DropDown has grown and I would like to be able to see more than the 8 lines that is the D/D limit 

Avatar
Catalin Bombea
Iasi, Romania
Admin
Level 10
Forum Posts: 1845
Member Since:
November 8, 2013
sp_UserOfflineSmall Offline
6
November 30, 2020 - 11:37 pm
sp_Permalink sp_Print

Hi Mel,

I understand what you need, but you also have to see things from our point of view.

You are saying that:
"For this I need to use a ComboBox but I cannot make the ComboBox work with Philip's code. "

I need to understand why you're saying that you cannot make it work: what error do you receive? In what part of the code?

Forum members are willing to help, but they cannot waste too much time to build from scratch a sample file for you, so they will ignore this topic until you provide clear info and a sample file with your attempts.

A topic with sample files and a clear description of the problem is more likely to receive a fast answer.

sp_Feed
Go to top
Forum Timezone: Australia/Brisbane
Most Users Ever Online: 245
Currently Online: Karolis Kmitas, Daisy Tang
Guest(s) 10
Currently Browsing this Page:
1 Guest(s)
Top Posters:
SunnyKow: 1432
Anders Sehlstedt: 880
Purfleet: 414
Frans Visser: 346
David_Ng: 306
lea cohen: 237
Jessica Stewart: 219
A.Maurizio: 213
Aye Mu: 201
Hans Hallebeek: 185
Newest Members:
Kwaje Alfred Mogga
thong nguyen
Appiagyei Kofi Frimpong
Hilary Burchfield
Richie Wright
Adel Kock
Barbara Murray
Doug Milne
Siobhan Stringer
Rob Rooth
Forum Stats:
Groups: 3
Forums: 24
Topics: 6544
Posts: 28650

 

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

Sidebar

Blog Categories

  • Excel
  • Excel Charts
  • Excel Dashboard
  • Excel Formulas
  • Excel Office Scripts
  • 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

Sign up to our newsletter and join over 400,000
others who learn Excel and Power BI with us.

 

Company

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

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.