Results 1 to 2 of 2

Thread: ComboBox expert help needed!!

Threaded View

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Feb 2006
    Posts
    96

    ComboBox expert help needed!!

    Hi all

    I'm trying to make a new reporting tool, and bounced into trouble right away.

    So far I have a datasheet (huge), and a starting page. On this starting page I have 5 comboboxes, default names are used, so they are called combobox1 to 5.

    I want the list in the combobox1 to 5, to consist of column a to e on the data sheet (about 30000 rows, but only 15 different valules).

    My code is;

    VB Code:
    1. Private Sub workbook_open()
    2. Dim sSheet As Worksheet
    3. Dim dSheet As Worksheet
    4. Dim aArray As Variant
    5. Dim bArray As Variant
    6. Dim cArray As Variant
    7. Dim dArray As Variant
    8. Dim eArray As Variant
    9. Dim i As Integer
    10.  
    11. Set sSheet = ActiveWorkbook.Sheets("Start")
    12. Set dSheet = ActiveWorkbook.Sheets("data")
    13.  
    14. With ActiveWorkbook.dSheet
    15.         aArray = .Range(.Cells(2, 1), .Cells(65000, 1))
    16.         bArray = .Range(.Cells(2, 2), .Cells(65000, 2))
    17.         cArray = .Range(.Cells(2, 3), .Cells(65000, 3))
    18.         dArray = .Range(.Cells(2, 4), .Cells(65000, 4))
    19.         eArray = .Range(.Cells(2, 5), .Cells(65000, 5))
    20. End With
    21.  
    22. For i = LBound(aArray) To UBound(aarray)
    23.     sSheet.combobox1.AddItem aarray(i)
    24. Next i
    25.  
    26. End Sub

    I've also tried using listfillrange - but this rendered me with the same result;

    "Compile Error: Method or data member not found"

    What am I missing??
    Last edited by direktoren; Jun 1st, 2006 at 06:12 PM. Reason: changed header

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width