Patriot2879
Well-known Member
- Joined
- Feb 1, 2018
- Messages
- 1,259
- Office Version
- 2010
- Platform
- Windows
Hi please can you help me, i have a Listbox1 where data is inoiutter from a userform, i have a spinbutton but i would like to toggle up and down the data in the listbox and if a row is highlighted to click on another arrow for this to then move the data over to sheet1. Can you help me please?
VBA Code:
Private Sub SpinButton1_Change()
On Error Resume Next
ListBox1.ListIndex = SpinButton1.Max - SpinButton1.Value
ActiveSheet.Select '?
ActiveSheet.Move After:=Sheets(ActiveSheet + 1) '?
On Error GoTo 0
End Sub
Private Sub SpinUserForm_Initialize()
Dim sh As Worksheet
For Each sh In Worksheets
ListBox1.AddItem ("Sheet1")
Next sh
With SpinButton1
.Min = 1
.Max = 50
.Value = .Max
End With
End Sub