Populating drop down list from another drop down list in Excel

Posted on 2003-02-25
Medium Priority
Last Modified: 2010-04-07
I made this Excel batch/application that is making a dynamic form from an external Oracle database and since it takes a long time to run, I have to minimise the operations and querys made by my application. Since the form is making a lot of drop down lists that are exactly the same, I thought that copying these from one another would be faster that going through SQL to populate each and every similar drop down objects.

Public Function Copy_List(ByVal as_ObjectName, as_SourceName as String) As Integer
     CopyList = 1
     On Error GoTo MyErrHandler
     // Copy from the Source_D_D_L to the Other_D_D_L
    MsgBox ("Error Copy_List: " & Err.Number _
            & " " & Err.Description _
            & " " & Err.Source)
    CopyList = -1
    Resume Next
End Function

Thanks 4 help !
Question by:Wiz_of_oz_777
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
LVL 12

Expert Comment

ID: 8020534
Assuming that you have added list items to ComboBox1 and want to copy them to ComboBox2:

ComboBox2.List = ComboBox1.List
LVL 12

Expert Comment

ID: 8020607
Public Function Copy_List(as_Source As ComboBox, as_Destination As ComboBox) As Integer
    Copy_List = 1
    On Error GoTo MyErrHandler
    as_Destination.List = as_Source.List
    Exit Function
   MsgBox ("Error Copy_List: " & Err.Number _
           & " " & Err.Description _
           & " " & Err.Source)
   Copy_List = -1
   Resume Next
End Function

MsgBox Copy_List(ComboBox1, ComboBox2)
LVL 12

Accepted Solution

jgv earned 300 total points
ID: 8044412
Did you find a solution to this question yet?

Expert Comment

ID: 8650129
any response on doing this?.. I need to do something similar.


Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…
Suggested Courses
Course of the Month7 days, 20 hours left to enroll

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question