Hi!

I am found this code on the web to add edit move data with a listbox and spin buttons Here

With this code i have to have the header in cell A1 and the data has to start from A2, but i need the header in A5 and the data to start from A6, could someone help me accomplish that ?



Spin button down:
Private Sub SpinButton1_SpinDown()
    Dim i As Long
    'change line below to reflect location of your list, and update listbox name
    With ThisWorkbook.Sheets("ListHolder")
        i = ListBox_Items.ListIndex + 1
        If i > 0 And i < .UsedRange.Rows.Count - 1 Then
            .Cells(i + 1, 1).Value = .Cells(i + 2, 1).Value
            .Cells(i + 2, 1) = ListBox_Items.Value
            populateBox
            ListBox_Items.Selected(i) = True
        End If
    End With
End Sub
Spin button up:
Private Sub SpinButton1_SpinUp()
    Dim i As Long
    i = ListBox_Items.ListIndex + 1
    If i > 1 And i < ActiveSheet.UsedRange.Rows.Count Then
        With ThisWorkbook.Sheets("ListHolder")
            .Cells(i + 1, 1).Value = .Cells(i, 1).Value
            .Cells(i, 1) = ListBox_Items.Value
        End With
        populateBox
        ListBox_Items.Selected(i - 2) = True
    End If
End Sub
I think it is the UsedRange thats is the problem when A1 to A4 is empty but im not sure.

Best regards

Petter