3

I'm working on my first ever VBA project, and need a bit of absolute newbie guidance.

  1. I have a submission form that staff will be using to submit their daily KPIs.
  2. I have a list box control in a user form called "lstName" that employees will use to select their name before submitting the form
  3. Employee names are stored in a named range on "Sheet11" called "EmpName".

I want to direct the list box to draw the list of names from the "EmpName" range on Sheet11; but don't know how I would do this in VBA. I was going to use RowSource to point the list box to the data, but I am lost as to how to do this.

Really simple question I know, and it has probably been answered in some way on the site, but since I'm completely new to VBA, the answers were beyond me. If someone could provide a stepped out answer that explains what the code is doing that would be amazing!

cazzzac
  • 59
  • 2
  • 3
  • 9

1 Answers1

4

Select your Userform and your ListBox, turn on Properties Window (View -> Properties or F4)

In the Properties Window navigate to the RowSource property and type Sheet11!EmpName

A simple boo example

enter image description here

  • 1
    Thank you so much! I was sure it was that simple! No doubt I will blunder through the rest of this form for a while yet :) – cazzzac May 08 '14 at 07:24
  • 1
    @cazzac It's not a `Form Control`. It is a `ListBox Control` in a user form :) – L42 May 08 '14 at 07:51
  • @L42 well it's actually an ActiveX type of Control. by "Form" I think the OP actually meant the Listbox control on a UserForm. –  May 08 '14 at 07:54