Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Show Last Record in the Listbox when userform Loads.

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
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
How to show Last Record in ListBox when loaded. Shazi Excel Programming 1 July 7th 08 08:44 AM
Hide Every Thing during UserForm Loads Shazi Excel Programming 2 June 24th 08 03:57 PM
Hide All Excel Toolbars, Menubars etc when UserForm Loads Shazi Excel Programming 2 June 18th 08 02:30 PM
UserForm Loads Slowly Stratuser Excel Programming 8 September 8th 06 04:47 AM
Using a listbox to show every unique record in a range [email protected] Excel Worksheet Functions 4 July 19th 06 06:04 PM


All times are GMT +1. The time now is 07:36 PM.

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

About Us

"It's about Microsoft Excel"