+ Reply to Thread
Results 1 to 6 of 6

source for combobox on userform

Hybrid View

  1. #1
    Registered User
    Join Date
    11-16-2007
    Posts
    14

    source for combobox on userform

    COCKS = Worksheets("SET").Range("B65336").End(xlUp).Row
    unknown = Worksheets("SET").Range("B2:B" & COCKS)
    is it possible to replace the unknown bit in the code so it displays that range in the combo box? any help please

  2. #2
    Forum Expert Simon Lloyd's Avatar
    Join Date
    03-02-2004
    Location
    locked in the cage
    MS-Off Ver
    All the ones my homepage shows
    Posts
    3,161
    Private Sub userform_initialize()
    Dim MyCell As Range
    Dim COCKS As Integer
    COCKS = Worksheets("SET").Range("B65336").End(xlUp).Row
    For Each MyCell In Worksheets("SET").Range("B2:B" & COCKS)
    Me.ComboBox1.AddItem (MyCell)
    Next MyCell
    End Sub
    Not all forums are the same - seek and you shall find

  3. #3
    Forum Contributor VBA Noob's Avatar
    Join Date
    04-25-2006
    Location
    London, England
    MS-Off Ver
    xl03 & xl 07(Jan 09)
    Posts
    11,988
    carlton123,

    Please read forum rules and the message to cross posters below

    VBA Noob
    _________________________________________


    Credo Elvem ipsum etian vivere
    _________________________________________
    A message for cross posters

    Please remember to wrap code.

    Forum Rules

    Please add to your signature if you found this link helpful. Excel links !!!

  4. #4
    Registered User
    Join Date
    11-16-2007
    Posts
    14
    thanks for that works a treat. sorry for cross posting got mixed up

  5. #5
    Registered User
    Join Date
    11-16-2007
    Posts
    14
    I Have modified it slightly but when i use exact same code for the hens i end up with a blank at the bottom i don't know where i have gone wrong. please see attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    11-16-2007
    Posts
    14
    sorry guys worked it out depends which item i added last a **** or a hen

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1