Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Using a listbox to show every unique record in a range [email protected] Excel Worksheet Functions 4 July 19th 06 06:04 PM
Always show new record Jenn Excel Discussion (Misc queries) 0 September 19th 05 07:59 PM
Why does my advance filter only show one record? Kyri Excel Discussion (Misc queries) 1 March 25th 05 03:13 AM
Help! Animated gif-image in form does not show animation when form loaded JoCa Excel Programming 4 September 23rd 04 07:43 PM
Show Record Macro Toolbar Wayne[_5_] Excel Programming 2 February 19th 04 05:45 PM


All times are GMT +1. The time now is 08:58 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"