View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Show Last Record in the Listbox when userform Loads.

See previous posting

--
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 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