View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default on Listbox in Userform....

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

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


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"x taol" wrote in message
...
hello.

The userform have two buttons and one listbox.

i want to move up or down a item of listbox.
first, select the item of listbox and if press a button(up) of two
button, the item move up one step....

but vba code, i don't know that.


*** Sent via Developersdex http://www.developersdex.com ***