Populating drop down list from another drop down list in Excel

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
MyErrHandler:
    MsgBox ("Error Copy_List: " & Err.Number _
            & " " & Err.Description _
            & " " & Err.Source)
    CopyList = -1
    Resume Next
End Function

Thanks 4 help !
Wiz_of_oz_777Asked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
jgvConnect With a Mentor Commented:
Did you find a solution to this question yet?
0
 
jgvCommented:
Assuming that you have added list items to ComboBox1 and want to copy them to ComboBox2:

ComboBox2.List = ComboBox1.List
0
 
jgvCommented:
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
   
MyErrHandler:
   MsgBox ("Error Copy_List: " & Err.Number _
           & " " & Err.Description _
           & " " & Err.Source)
   Copy_List = -1
   Resume Next
End Function


MsgBox Copy_List(ComboBox1, ComboBox2)
0
 
NO_CARRIERCommented:
any response on doing this?.. I need to do something similar.

nC
0
All Courses

From novice to tech pro — start learning today.