Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Okay, Let's ask this another way

Hee's a couple of routines

Dim vTemp, vtemp1

With ListBox1
If .ListIndex 0 Then
vTemp = .Value
vtemp1 = .List(.ListIndex, 2)
.List(.ListIndex) = .List(.ListIndex - 1)
.List(.ListIndex, 2) = .List(.ListIndex - 1, 2)
.List(.ListIndex - 1) = vTemp
.List(.ListIndex - 1, 2) = vtemp1
.ListIndex = .ListIndex - 1
End If
End With
End Sub

Dim vTemp, vtemp1

With ListBox1
If .ListIndex < .ListCount - 1 Then
vTemp = .Value
vtemp1 = .List(.ListIndex, 2)
.List(.ListIndex) = .List(.ListIndex + 1)
.List(.ListIndex + 1) = vTemp
.List(.ListIndex + 1, 2) = vtemp1
.ListIndex = .ListIndex + 1
End If
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"asmenut" wrote in message
...
Is there a way to use a multi-column list box to reorder rows of data

(i.e.
move up / move down)?



  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 59
Default Okay, Let's ask this another way

Thanks

"Bob Phillips" wrote:

Hee's a couple of routines

Dim vTemp, vtemp1

With ListBox1
If .ListIndex 0 Then
vTemp = .Value
vtemp1 = .List(.ListIndex, 2)
.List(.ListIndex) = .List(.ListIndex - 1)
.List(.ListIndex, 2) = .List(.ListIndex - 1, 2)
.List(.ListIndex - 1) = vTemp
.List(.ListIndex - 1, 2) = vtemp1
.ListIndex = .ListIndex - 1
End If
End With
End Sub

Dim vTemp, vtemp1

With ListBox1
If .ListIndex < .ListCount - 1 Then
vTemp = .Value
vtemp1 = .List(.ListIndex, 2)
.List(.ListIndex) = .List(.ListIndex + 1)
.List(.ListIndex + 1) = vTemp
.List(.ListIndex + 1, 2) = vtemp1
.ListIndex = .ListIndex + 1
End If
End With


--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)

"asmenut" wrote in message
...
Is there a way to use a multi-column list box to reorder rows of data

(i.e.
move up / move down)?




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



All times are GMT +1. The time now is 05:27 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"