Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Auto move scroll bars of listbox

Dear Ng,

I had created a user form which is not modal that serves as splash screen
while my macro runs into the background. This userform includes a listbox
that is populated during runtime. My problem now is that when the entries
in the listbox exceed beyond it size, the latest entries are being hide in
view. Is there a way that I can move the scroll bars of the listbox so that
I can show the latest entries in view.

All help will be highly appreciated.

Regards,

Jon-jon




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Auto move scroll bars of listbox

Look at the topIndex property of the Listbox.

--
Regards,
Tom Ogilvy

"JON JON" wrote in message
...
Dear Ng,

I had created a user form which is not modal that serves as splash screen
while my macro runs into the background. This userform includes a

listbox
that is populated during runtime. My problem now is that when the

entries
in the listbox exceed beyond it size, the latest entries are being hide

in
view. Is there a way that I can move the scroll bars of the listbox so

that
I can show the latest entries in view.

All help will be highly appreciated.

Regards,

Jon-jon






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Auto move scroll bars of listbox

topindex demo...

Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Private Sub UserForm_activate()
Dim i%
With ListBox1
For i = 1 To 100
.AddItem "item" & Format(i, " 000")
If .ListCount 5 Then
.TopIndex = .ListCount - 5
End If
Me.Repaint
Sleep 100
Next
End With
Unload Me
End Sub

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Tom Ogilvy wrote :

Look at the topIndex property of the Listbox.

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Auto move scroll bars of listbox

Keep ITcool,

Thank you very much it was a great help.

Can you please extend more help by explaining what does the "Sleep 100" do?
I am just really curious about it.

TIA,

Jon-jon



"keepITcool" wrote in message
ft.com...
topindex demo...

Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Private Sub UserForm_activate()
Dim i%
With ListBox1
For i = 1 To 100
.AddItem "item" & Format(i, " 000")
If .ListCount 5 Then
.TopIndex = .ListCount - 5
End If
Me.Repaint
Sleep 100
Next
End With
Unload Me
End Sub

--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Tom Ogilvy wrote :

Look at the topIndex property of the Listbox.



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Auto move scroll bars of listbox

Jon, jon

similar as application.wait the Sleep function suspends the execution
of the current thread for a specified interval. This is a so called
windows API call.

the sleep is just for the demo to keep the loop slow enough to see it
move...



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


JON JON wrote :

Keep ITcool,

Thank you very much it was a great help.

Can you please extend more help by explaining what does the "Sleep
100" do? I am just really curious about it.

TIA,

Jon-jon



"keepITcool" wrote in message
ft.com...
topindex demo...

Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Private Sub UserForm_activate()
Dim i%
With ListBox1
For i = 1 To 100
.AddItem "item" & Format(i, " 000")
If .ListCount 5 Then
.TopIndex = .ListCount - 5
End If
Me.Repaint
Sleep 100
Next
End With
Unload Me
End Sub

--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam



Tom Ogilvy wrote :

Look at the topIndex property of the Listbox.



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 62
Default Auto move scroll bars of listbox

Again, thank you very much


"keepITcool" wrote in message
ft.com...
Jon, jon

similar as application.wait the Sleep function suspends the execution
of the current thread for a specified interval. This is a so called
windows API call.

the sleep is just for the demo to keep the loop slow enough to see it
move...



--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


JON JON wrote :

Keep ITcool,

Thank you very much it was a great help.

Can you please extend more help by explaining what does the "Sleep
100" do? I am just really curious about it.

TIA,

Jon-jon



"keepITcool" wrote in message
ft.com...
topindex demo...

Declare Sub Sleep Lib "kernel32.dll" (ByVal dwMilliseconds As Long)

Private Sub UserForm_activate()
Dim i%
With ListBox1
For i = 1 To 100
.AddItem "item" & Format(i, " 000")
If .ListCount 5 Then
.TopIndex = .ListCount - 5
End If
Me.Repaint
Sleep 100
Next
End With
Unload Me
End Sub

--
keepITcool
www.XLsupport.com | keepITcool chello nl | amsterdam


Tom Ogilvy wrote :

Look at the topIndex property of the Listbox.



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 use the scroll bars to move objects Ash New Users to Excel 8 October 31st 08 07:39 AM
excel-how to get the spreadsheet to move as I move the scroll tab excel toiler Excel Discussion (Misc queries) 6 November 7th 07 06:07 PM
Scroll bars Tazzy via OfficeKB.com Excel Discussion (Misc queries) 3 December 10th 06 10:28 PM
Scroll bars Embalmer Excel Discussion (Misc queries) 1 December 31st 05 05:05 PM
When I move scroll bar in excell the contents do not move with it ramneek Excel Discussion (Misc queries) 2 June 29th 05 07:35 PM


All times are GMT +1. The time now is 04:13 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"