Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default spin up / spin down

I have 2 listboxes (LB1 and LB2) side by side on a form. There are over 300
items in each list box. Each list box has been loaded. Now I would like to
use a spin button to move up and down through each list box. Any help on
getting started with the code to move up and down through the list boxes
would be GREATLY appreciated. Thanks for all of the help........

FYI...there are 6 columns of various length in each list box. Does this
make a difference? I'm considering combining my data for each row into a
single column. Do I need to do that to use a spin button?
--
JT
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default spin up / spin down

Private Sub SpinButton1_SpinDown()
With ListBox1
If .ListIndex < .ListCount - 1 Then
.ListIndex = .ListIndex + 1
End If
End With
End Sub

Private Sub SpinButton1_SpinUp()
With ListBox1
If .ListIndex 0 Then
.ListIndex = .ListIndex - 1
End If
End With
End Sub

worked for me. Adjust it to handle two listboxes.

--
Regards,
Tom Ogilvy


"JT" wrote:

I have 2 listboxes (LB1 and LB2) side by side on a form. There are over 300
items in each list box. Each list box has been loaded. Now I would like to
use a spin button to move up and down through each list box. Any help on
getting started with the code to move up and down through the list boxes
would be GREATLY appreciated. Thanks for all of the help........

FYI...there are 6 columns of various length in each list box. Does this
make a difference? I'm considering combining my data for each row into a
single column. Do I need to do that to use a spin button?
--
JT

  #3   Report Post  
Posted to microsoft.public.excel.programming
JT JT is offline
external usenet poster
 
Posts: 234
Default spin up / spin down

Thank You very much.......It is working exactly like I want it to.

One more question.......is it possible to highlight the first row in each
listbox when the form opens and then move the highlighted row either up or
down with the spin button?

Thanks again for all of the help..
--
JT


"Tom Ogilvy" wrote:

Private Sub SpinButton1_SpinDown()
With ListBox1
If .ListIndex < .ListCount - 1 Then
.ListIndex = .ListIndex + 1
End If
End With
End Sub

Private Sub SpinButton1_SpinUp()
With ListBox1
If .ListIndex 0 Then
.ListIndex = .ListIndex - 1
End If
End With
End Sub

worked for me. Adjust it to handle two listboxes.

--
Regards,
Tom Ogilvy


"JT" wrote:

I have 2 listboxes (LB1 and LB2) side by side on a form. There are over 300
items in each list box. Each list box has been loaded. Now I would like to
use a spin button to move up and down through each list box. Any help on
getting started with the code to move up and down through the list boxes
would be GREATLY appreciated. Thanks for all of the help........

FYI...there are 6 columns of various length in each list box. Does this
make a difference? I'm considering combining my data for each row into a
single column. Do I need to do that to use a spin button?
--
JT

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
Spin box increase value only Mark N Excel Discussion (Misc queries) 1 August 27th 09 03:51 PM
Spin Button [email protected] Excel Programming 4 June 12th 05 07:43 PM
New spin on old problems Arlen[_2_] Excel Programming 9 January 16th 04 06:46 PM
Spin Control John C[_4_] Excel Programming 4 September 24th 03 03:14 AM
Spin Button Andrew[_14_] Excel Programming 1 July 18th 03 01:51 AM


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