+ Reply to Thread
Results 1 to 2 of 2

combobox fill problem

  1. #1
    Pierre via OfficeKB.com
    Guest

    combobox fill problem

    Hi experts,
    i have the following code to fill a combobox

    Private Sub UserForm_Initialize()
    With Sheets("hulpblad")
    cbo_accountnr.RowSource = "b2:c500"
    End With
    End Sub

    This works fine but the userform on which the combo is, is used on sheet 1
    where the combobox should be filled with items on sheet("hulpblad")
    In my code the With sheets("hulpblad") does not work when i call the userform
    in sheet1.
    I get the list"b2"c500" from sheet1 istead of the list from sheet("hulpblad")
    Can anyone help me please ?
    Thanks,
    Pierre

    --
    Message posted via OfficeKB.com
    http://www.officekb.com/Uwe/Forums.a...mming/200512/1

  2. #2
    Toppers
    Guest

    RE: combobox fill problem

    Try:

    Private Sub UserForm_Initialize()

    cbo_accountnr.RowSource = "hulpblad!b2:c500"

    End Sub

    "Pierre via OfficeKB.com" wrote:

    > Hi experts,
    > i have the following code to fill a combobox
    >
    > Private Sub UserForm_Initialize()
    > With Sheets("hulpblad")
    > cbo_accountnr.RowSource = "b2:c500"
    > End With
    > End Sub
    >
    > This works fine but the userform on which the combo is, is used on sheet 1
    > where the combobox should be filled with items on sheet("hulpblad")
    > In my code the With sheets("hulpblad") does not work when i call the userform
    > in sheet1.
    > I get the list"b2"c500" from sheet1 istead of the list from sheet("hulpblad")
    > Can anyone help me please ?
    > Thanks,
    > Pierre
    >
    > --
    > Message posted via OfficeKB.com
    > http://www.officekb.com/Uwe/Forums.a...mming/200512/1
    >


+ 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