Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am trying to make a listbox which is populated from a named range in
Excel that can then be reordered by clicking and dragging rows in the listbox. I have found VB code that can do it, but when I tred to recreate it in VBA I found that one of the properties, .NewIndex, does not seem to exist in VBA. Here is the code with the nonexistant property in it: Private Sub ListBox1_Click() End Sub Private Sub ListBox1_MouseDown(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) With ListBox1 DragIndex = .ListIndex End With End Sub Private Sub ListBox1_MouseUp(ByVal Button As Integer, ByVal Shift As Integer, ByVal X As Single, ByVal Y As Single) With ListBox1 If DragIndex < .ListIndex Then ListTest = .List(DragIndex) .RemoveItem DragIndex .AddItem ListText, .ListIndex + Abs(Shift = vbShiftMask) .ListIndex = .NewIndex '<----**THIS IS THE PROBLEM**---< End If End With End Sub Private Sub UserForm_Click() End Sub Can anyone show this complete newbe a way around this missing property? Paul |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
i need an excel template for property management | Excel Discussion (Misc queries) | |||
I need a Excel template for property management | Excel Discussion (Misc queries) | |||
Is there a Filename property in PrintOut property | Excel Programming | |||
New UsedObjects Property in Excel XP | Excel Programming | |||
HELP - simple VBA property causes Excel to crash | Excel Programming |