Hi friends,
I need a syntax to dislplay my last entry in a list box.
every time I enter a new data; it goes all the way to the bottom and I can't see
my last entry. It'll be nice to see my last entries at the beginig of the list!
Hope anyone can help. I've been strugeling a long time with this Problem!
How are you adding to the ListBox entries?
Where is the ListBox
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
I'm not sure what you are asking.
To add a new item to the top of a list box, use the Item argument of .AddItem
To scroll a listbox to a spot in the list, the .TopIndex property should be used.Code:ListBox1.AddItem "new item", 0
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
Thank you for helping; I'm curretly using 2007 excel and I'm created my own POS system using VBA coding for my Mom store. The problem is when she keeps entering products it disapears on the bottom of the list an she can't see the last entries and so she has to force it with the mouse
to be able to see it.
I typed the line you provided but i didn't work
Private Sub ListBox1_Click()
ListBox1.AddItem "new item", 0
End Sub
I used top index, but it does't work either.
the Rowsource i have it as C10:G30 under List box Properties menu!
sorry for creating so much trouble. I promesed her to fix it by her birth day. it just one of those things!
How does she "enter a product"?
_
...How to Cross-post politely...
..Wrap code by selecting the code and clicking the # or read this. Thank you.
HI ferrete
If you can post your workbook so we can see what's happening, I'm fairly certain someone on this forum can solve your issue byJohnby her birth day
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
Your post does not comply with Rule 3 of our Forum RULES. Use code tags around code. Posting code without them makes your code hard to read and difficult to be copied for testing. Highlight your code and click the # at the top of your post window. For more information about these and other tags, found here
Hope that helps.
RoyUK
--------
If you are pleased with a member's answer then use the Star icon to rate it, if you are pleased enough to part with cash consider a donation to Children in Need
For Excel consulting, free examples and tutorials visit Excel Consulting-Excel VBA
Check out the free Excel Toolbar
New members please read & follow the Forum Rules
Remember to mark your questions Solved and rate the answer(s)
Code Tags: Make your code easier for us to read
I'm using this syntax to Input data , as she keeps putting code and quanity the info acumulates on the bottom of the list but when she keeps entering more products codes she can't longer see the last entries. It'll be nice the last entry show up always on the top of the list or the scrolling bar stays down to be able to see the last entry eather or would be just fine!
I tried using topIndex on properties and got to force it down but every time I run the form the scroll bar ges back to the top again!
Option Explicit
Sub GetData()
Dim NextRow As Long
Dim Entry1 As String, Entry2 As String
Do
'Determine next empty row
NextRow = Cells(Rows.Count, 3).End(xlUp).Row + 1
' Prompt for the data
Entry1 = InputBox("Codigo")
If Entry1 = "" Then Exit Sub
Entry2 = InputBox("Cantidad")
If Entry2 = "" Then Exit Sub
Hi ferrete
I see you're new to the Forum. You probably won't get too many responses until you follow RoyUK's admonishment in Post #7. USE CODE TAGS. Also, post a sample of your workbook.
John
John
If you have issues with Code I've provided, I appreciate your feedback.
In the event Code provided resolves your issue, please click EDIT in your original post, click GO ADVANCED and set the PREFIX box to SOLVED.
If you're satisfied by any members response to your issue please use the star icon at the lower left of their post.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks