List box data

  • Thread starter Thread starter mike
  • Start date Start date
M

mike

I noticed that when you placed a listbox on wrksht you
can use a data list for your ListFIllRange. But when you
want a listbox on a userform...there isnt a
ListFillRange. Does this mena i will have to do a ADDITEM
on a initialize procdure b4 it opens? Can i attached
alist or reference one?? My data list is about 60 rows
long?? Did i miss another way somewhere?? any help thanks!
 
In the userform it is called RowSource. The actual property is provided by
the container - (oleObject on worksheet, control on userform) thus a
difference. So look for the RowSource propert and set it to
Sheet1!A1:B20

for example.
 
Okay , another question... you know how you can (once you
have highligted in the list of the list box?? you can
just type the frst letter of your choice and it goes to
it?? how do i modify code to where you can repeat that
letter key tillyou get thru a list of "t" 's tillyour
choice comes up?
 
From help on the matchentry property of the combobox/listbox


constant: fmMatchEntryFirstLetter

value: 0

Explanation:
Basic matching. The control searches for the next entry that starts with the
character entered. Repeatedly typing the same letter cycles through all
entries beginning with that letter.

Please see the help on this however for a fuller explanation and other
considerations.
 
tom , silly me , i found once i have studied each
property in the property box of the control. However..I
have one more for the day....Once i have created the
form..How do I launch the form? what module do i oput the
the show code in? I would liek the form to show up when
that workbook is opened and then closed when it is
closed. is it possible to attach the formto a icon on the
worksheet and let it be clicked to show the form??
 
if you want it displayed when the workbook is opened, then use the
workbook_Open event. Also see the BeforeClose Event

see Chip Pearson's page on Events

http://www.cpearson.com/excel/events.htm

for a button from the forms toolbar, create a macro in a standard module

Sub Btn_Click()
userform1.show
End Sub

then assign it to your button.

if you mean on a toolbar, then do tools=>customize, then create a new
toolbar or add a button to an existing toolbar and assign your macro
(btn_click) to that.

If you just want to run the macro, then run btn_click

If from a commandbar button on the worksheet, drag the button onto the
worksheet and double click on it. In the resulting procedure, put in code
like

Private Sub Commandbutton1_Click()
userform1.show
End Sub
 
Back
Top