Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 45
Default Determining if data is sorted in descending order

I capture the pre-sorted data to an array, then show a form to ask user to
sort descending; In the form, user clicks button after sorting and I want to
compare pre sorted to post sorted values; can't pass the presorted array to
the buttons click event. Ideas for a workaround? TY
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Determining if data is sorted in descending order


Not sure if I understand correctly...

Code
-------------------

Private Sub CommandButton1_Click()
Dim a, i As long, myRange
Set myRange = Range("a1:a100")
If vbYes = MsgBox("Sort Descending Order?",vbYesNo) Then
With myRange
a = .Value
.Sort key1:= .Cells(1,1), order1:= xlDescending, header:= xlNo
For i = 1 To .Rows.Count
If .Cells(i,1) < a(i, 1) Then
MsgBox "Not Sorted in Descengind Order"
.Value = a
Exit Sub
End If
Next
End With
End If
MsgBox "Sorted successfully"
End Su
-------------------

--
jindo
-----------------------------------------------------------------------
jindon's Profile: http://www.excelforum.com/member.php...fo&userid=1313
View this thread: http://www.excelforum.com/showthread.php?threadid=55070

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
moving row data to a colunm in sorted order moving row data to a column in a sorted Excel Worksheet Functions 9 February 23rd 10 10:54 PM
move a row of data values to a column in sorted order moving row data to a column in a sorted[_2_] Excel Discussion (Misc queries) 2 February 21st 10 11:13 PM
descending order of a series of data kent[_2_] Excel Worksheet Functions 8 December 14th 09 05:00 AM
How to order chart in descending order of Freq? Gary Charts and Charting in Excel 1 October 1st 09 01:03 PM
Top 10 in descending order Esradekan Excel Worksheet Functions 8 September 24th 07 02:54 AM


All times are GMT +1. The time now is 01:25 AM.

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

About Us

"It's about Microsoft Excel"