listbox

T

tbailey

Hi all i have a listbox that shows all that data enterd on a sheet1 the
listboxs just shows it but , i would like the listbox to go to that last
entery in the list , the list is long that way you dont have to sroll-down
the list to see what you just enterd .
 
R

redeagle

Hi tbailey-

If you are familiar with VBA, try using somthing like:

Sheet1.ListBox1.ListIndex = Sheet1.ListBox1.ListCount - 1

John
 
T

tbailey

Yes i work with VBA the list box is on a userform.
that code it tryed it did not work. do i need to put this code in the
Initialize,
 
R

redeagle

Hi tbailey-

If you are using a userform then replace "sheet1" with "Me" and "ListBox1"
with whatever the name of the listbox is on your form.

You should place this code after the code that adds an item to the list box.

John
 
T

tbailey

thank you for that part. now i just need it to stop at the first empty cell,
it go all the way to 65536
 
T

tbailey

Sheet1.ListBox1.ListIndex = Sheet1.ListBox1.ListCount - 1
Range("A1").selection
Ramge(Selection, Selection.End(xlDown)).Select
will go to 65536 to i may need to have the listbox not show empty cell in it
like this
Sheet1.ListBox1.ListIndex = Sheet1.ListBox1.ListCount - 1
if cells = 0 dont show for the list box , i dont knoe the code for this?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top