#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Short List



Is there a way to make this userForm to sort my information ?
Thanks in Advance

Antonyo
Regards


Private Sub CommandButton1_Click()
Dim iListCount As Integer, iColCount As Integer
Dim iRow As Integer
Dim rStartCell As Range
'Set a range variable to the first cell to recieve our data
'Using "End(xlUp).Offset(1, 0)" _
will give us the cell below the last entry
Set rStartCell = Sheet3.Range("F65536").End(xlUp).Offset(1, 0)
'Loop as many times (less one) as there are entries in our list.
'We must start from zero to use this in the Selected Property.
For iListCount = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(iListCount) = True Then 'User has selected
ListBox1.Selected(iListCount) = False
iRow = iRow + 1
'Now loop as many times as there are columns in MyRange
For iColCount = 0 To Range("MyRange").Columns.Count - 1
'place the selected data into the table, starting from _
range Ax and moving across as many columns as there are _
in the range MyRange.
rStartCell.Cells(iRow, iColCount + 1).Value = _
ListBox1.List(iListCount, iColCount)
Next iColCount
End If
Next iListCount
Set rStartCell = Nothing
Unload Me
End Sub


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,092
Default Short List

Perhaps you can use the sort code from this routine...
http://j-walk.com/ss/excel/tips/tip47.htm

Mike F
"Antonio Atala" wrote in message
...


Is there a way to make this userForm to sort my information ?
Thanks in Advance

Antonyo
Regards


Private Sub CommandButton1_Click()
Dim iListCount As Integer, iColCount As Integer
Dim iRow As Integer
Dim rStartCell As Range
'Set a range variable to the first cell to recieve our data
'Using "End(xlUp).Offset(1, 0)" _
will give us the cell below the last entry
Set rStartCell = Sheet3.Range("F65536").End(xlUp).Offset(1, 0)
'Loop as many times (less one) as there are entries in our list.
'We must start from zero to use this in the Selected Property.
For iListCount = 0 To ListBox1.ListCount - 1
If ListBox1.Selected(iListCount) = True Then 'User has selected
ListBox1.Selected(iListCount) = False
iRow = iRow + 1
'Now loop as many times as there are columns in MyRange
For iColCount = 0 To Range("MyRange").Columns.Count - 1
'place the selected data into the table, starting from _
range Ax and moving across as many columns as there are _
in the range MyRange.
rStartCell.Cells(iRow, iColCount + 1).Value = _
ListBox1.List(iListCount, iColCount)
Next iColCount
End If
Next iListCount
Set rStartCell = Nothing
Unload Me
End Sub




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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Extract Data to Creat Short List Excelstein Excel Discussion (Misc queries) 5 January 11th 10 04:21 PM
Short listing the Data Validation List Asoka Walpitagama - Brandix College IT Excel Discussion (Misc queries) 2 November 12th 09 07:12 AM
excel short list Mike Rogers[_2_] Excel Discussion (Misc queries) 0 February 10th 09 02:31 AM
Random names from short list Jose Lopes Excel Worksheet Functions 4 March 12th 08 04:19 PM
key board short cut keys list albert Excel Discussion (Misc queries) 1 March 12th 07 10:32 AM


All times are GMT +1. The time now is 06:50 AM.

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"