Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to show Last Record in ListBox when loaded.
Hi,
when I load my userform, the following procedure is showing the listbox first record. how I can view the last record when userform loads. 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 Private Sub CommandButton1_Click() Unload Me End Sub Pls give me the suggession how can I show the last record when userform load. Best Regards. Syed Shahzad Zafar Madinah |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
How to show Last Record in ListBox when loaded.
Me.ListBox1.ListIndex = Me.ListBox1.ListCount - 1
-- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "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 when userform loads. 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 Private Sub CommandButton1_Click() Unload Me End Sub Pls give me the suggession how can I show the last record when userform load. Best Regards. Syed Shahzad Zafar Madinah |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Using a listbox to show every unique record in a range | Excel Worksheet Functions | |||
Always show new record | Excel Discussion (Misc queries) | |||
Why does my advance filter only show one record? | Excel Discussion (Misc queries) | |||
Help! Animated gif-image in form does not show animation when form loaded | Excel Programming | |||
Show Record Macro Toolbar | Excel Programming |