Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Listbox Scroll Problem

Duuuuudes:

I have a problem with scrolling to the bottom of a listbox in excel '03. I'm
using the listbox control in vba, not the excel forms control. Anyway, when I
scroll to the bottom of the list, it won't let me see the last item in the
list box. It will stop one short and will actually have a space below the
scroll bar that looks like it could scroll down one more list item but won't.
I'm using the additem call to populate the listbox. I've tried recreating the
listbox and it will work the first time it gets populated but seems like
after repopulating it a couple times it will cause the problem. Can anyone
shed some light on why this would be doing this?

Here's the code for populating the listbox:

'repopulate the lbdate listbox
For i = 1 To wsfd.Range("FD_InProcDateData").Count
TempDate = wsfd.Range("FD_InProcDateData").Cells(i).Value
TempDay = Weekday(TempDate)
Select Case TempDay
'sunday for facility x
Case 1
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "V"
End With
'monday thru friday for facility y
Case 2 To 6
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "BC"
End With
'saturday for facility z
Case 7
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "D&D"
End With
End Select
'skip to next date
Do
i = i + 1
Loop Until wsfd.Range("FD_InProcDateData").Cells(i).Value < TempDate Or
i = wsfd.Range("FD_InProcDateData").Count
'if i equals the range count then exit the for statement. if this isn't
done, the last schedule date will show twice.
If i = wsfd.Range("FD_InProcDateData").Count Then
Exit For
End If
'backup a cell because of the next i statement
i = i - 1
Next i



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Listbox Scroll Problem

If you use a whole number for the listbox height, does that help?

If not, can you make the listbox a little taller (or shorter)?

DeathSurfer wrote:

Duuuuudes:

I have a problem with scrolling to the bottom of a listbox in excel '03. I'm
using the listbox control in vba, not the excel forms control. Anyway, when I
scroll to the bottom of the list, it won't let me see the last item in the
list box. It will stop one short and will actually have a space below the
scroll bar that looks like it could scroll down one more list item but won't.
I'm using the additem call to populate the listbox. I've tried recreating the
listbox and it will work the first time it gets populated but seems like
after repopulating it a couple times it will cause the problem. Can anyone
shed some light on why this would be doing this?

Here's the code for populating the listbox:

'repopulate the lbdate listbox
For i = 1 To wsfd.Range("FD_InProcDateData").Count
TempDate = wsfd.Range("FD_InProcDateData").Cells(i).Value
TempDay = Weekday(TempDate)
Select Case TempDay
'sunday for facility x
Case 1
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "V"
End With
'monday thru friday for facility y
Case 2 To 6
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "BC"
End With
'saturday for facility z
Case 7
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "D&D"
End With
End Select
'skip to next date
Do
i = i + 1
Loop Until wsfd.Range("FD_InProcDateData").Cells(i).Value < TempDate Or
i = wsfd.Range("FD_InProcDateData").Count
'if i equals the range count then exit the for statement. if this isn't
done, the last schedule date will show twice.
If i = wsfd.Range("FD_InProcDateData").Count Then
Exit For
End If
'backup a cell because of the next i statement
i = i - 1
Next i


--

Dave Peterson
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 15
Default Listbox Scroll Problem

Thanks for those suggestions Dave, but I've already tried to do both and
neither have worked. This problem has really got me stumped. I've tried so
many things and nothing seems to fix this.

"Dave Peterson" wrote:

If you use a whole number for the listbox height, does that help?

If not, can you make the listbox a little taller (or shorter)?

DeathSurfer wrote:

Duuuuudes:

I have a problem with scrolling to the bottom of a listbox in excel '03. I'm
using the listbox control in vba, not the excel forms control. Anyway, when I
scroll to the bottom of the list, it won't let me see the last item in the
list box. It will stop one short and will actually have a space below the
scroll bar that looks like it could scroll down one more list item but won't.
I'm using the additem call to populate the listbox. I've tried recreating the
listbox and it will work the first time it gets populated but seems like
after repopulating it a couple times it will cause the problem. Can anyone
shed some light on why this would be doing this?

Here's the code for populating the listbox:

'repopulate the lbdate listbox
For i = 1 To wsfd.Range("FD_InProcDateData").Count
TempDate = wsfd.Range("FD_InProcDateData").Cells(i).Value
TempDay = Weekday(TempDate)
Select Case TempDay
'sunday for facility x
Case 1
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "V"
End With
'monday thru friday for facility y
Case 2 To 6
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "BC"
End With
'saturday for facility z
Case 7
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "D&D"
End With
End Select
'skip to next date
Do
i = i + 1
Loop Until wsfd.Range("FD_InProcDateData").Cells(i).Value < TempDate Or
i = wsfd.Range("FD_InProcDateData").Count
'if i equals the range count then exit the for statement. if this isn't
done, the last schedule date will show twice.
If i = wsfd.Range("FD_InProcDateData").Count Then
Exit For
End If
'backup a cell because of the next i statement
i = i - 1
Next i


--

Dave Peterson

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Listbox Scroll Problem

Sorry.

I thought I had read that others had fixed this kind of problem by using an
integral/whole number height.

I don't have another guess.

DeathSurfer wrote:

Thanks for those suggestions Dave, but I've already tried to do both and
neither have worked. This problem has really got me stumped. I've tried so
many things and nothing seems to fix this.

"Dave Peterson" wrote:

If you use a whole number for the listbox height, does that help?

If not, can you make the listbox a little taller (or shorter)?

DeathSurfer wrote:

Duuuuudes:

I have a problem with scrolling to the bottom of a listbox in excel '03. I'm
using the listbox control in vba, not the excel forms control. Anyway, when I
scroll to the bottom of the list, it won't let me see the last item in the
list box. It will stop one short and will actually have a space below the
scroll bar that looks like it could scroll down one more list item but won't.
I'm using the additem call to populate the listbox. I've tried recreating the
listbox and it will work the first time it gets populated but seems like
after repopulating it a couple times it will cause the problem. Can anyone
shed some light on why this would be doing this?

Here's the code for populating the listbox:

'repopulate the lbdate listbox
For i = 1 To wsfd.Range("FD_InProcDateData").Count
TempDate = wsfd.Range("FD_InProcDateData").Cells(i).Value
TempDay = Weekday(TempDate)
Select Case TempDay
'sunday for facility x
Case 1
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "V"
End With
'monday thru friday for facility y
Case 2 To 6
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "BC"
End With
'saturday for facility z
Case 7
With wsr.Range("R_Location")
Worksheets("Report").lbdate.AddItem TempDate & " " & "D&D"
End With
End Select
'skip to next date
Do
i = i + 1
Loop Until wsfd.Range("FD_InProcDateData").Cells(i).Value < TempDate Or
i = wsfd.Range("FD_InProcDateData").Count
'if i equals the range count then exit the for statement. if this isn't
done, the last schedule date will show twice.
If i = wsfd.Range("FD_InProcDateData").Count Then
Exit For
End If
'backup a cell because of the next i statement
i = i - 1
Next i


--

Dave Peterson


--

Dave Peterson
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
Controlling Listbox Scroll Bars Mike Milligan Excel Programming 1 October 25th 06 03:55 AM
getting a horizontal scroll bar in listbox jmoffat[_27_] Excel Programming 1 March 3rd 06 01:24 PM
Listbox Scroll Todd Huttenstine Excel Programming 2 June 15th 04 02:23 PM
How to get rid of the bottom scroll bar in a ListBox Valeria[_2_] Excel Programming 2 January 23rd 04 12:48 PM
listbox doesn't scroll properly Deer Hunter Excel Programming 0 August 4th 03 02:11 PM


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