Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You are welcome, but you bottom-posted your answer again.
Rick "Shazi" wrote in message ... On Jul 16, 7:13 pm, "Rick Rothstein \(MVP - VB\)" wrote: << Top-Posted Listing Repaired Please use the same posting order as your responder; in the case of this thread, I top-posted my reply, so you should have top-posted your reply to me (this makes it easier for anyone looking at this thread in the archives to follow the replies in order of their posting). To answer your question, the ListIndex is a zero-based index into the list (much like the index value of an array). Since you want the first item in the ListBox, and since the ListIndex is a zero-based index, you would use this.... ListBox1.ListIndex = 0 to select the first item in the list. Rick If I want to see the first record in the Listbox then what to do. pls help me. "Shazi" wrote in message ... On Jul 7, 10:50 am, "Rick Rothstein \(MVP - VB\)" wrote: I think you want to do this at the end of your code... ListBox1.ListIndex = ListBox1.ListCount - 1 Rick "Shazi" wrote in message ... Hi, when I load my userform, the following procedure is showing the listbox first record. how I can view the last record in the ListBox when userform loads. I am using this code: Option Explicit Dim LastRow As Long Private Sub UserForm_Initialize() Sheets("DailyIssue").Select 'to hide Blank Rows in ListBox. LastRow = Worksheets("DailyIssue").Cells(Rows.Count, "A").End(xlUp).Row ListBox1.RowSource = "A5:J" & LastRow End Sub Regards. Syed Shahzad Zafar- Hide quoted text - - Show quoted text -- Hide quoted text - - Show quoted text - Hi, Thank you Mr. Rick, now its working properly. Regards. Shahzad |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to show Last Record in ListBox when loaded. | Excel Programming | |||
Hide Every Thing during UserForm Loads | Excel Programming | |||
Hide All Excel Toolbars, Menubars etc when UserForm Loads | Excel Programming | |||
UserForm Loads Slowly | Excel Programming | |||
Using a listbox to show every unique record in a range | Excel Worksheet Functions |