Here is another solution which reduces time to execute from 30 sec to jst less than 2 sec. the problem with previous code was it was swapping rows so many times. in this code i am making copy of 'A' column and sorting it first, and then making one temp range in which i am saving entire rows of values which are sorted (Column 'A' entries) and then replacing temporary sorted range into original range.
Private Sub QuickAscending_Click()
Dim myRange As Range 'variable to hold the Named Range
Dim rowCount As Long 'variable to hold the Number of Rows in myRange
Dim colCount As Long 'variable to hold the Number of Columns in myRange
Dim rowStartIndex As Long 'variable to hold the Starting Row index of myRange
Dim colStartIndex As Long 'variable to hold the Starting Col index of myRange
Dim iIndex As Long 'Variable used for iteration
Dim jIndex As Long 'Variable used for iteration
Dim current As Long 'used in bubble sort to hold the value of the current jIndex item
Dim currentPlusOne As Long 'used in bubble sort to hold the value of the jIndex+1 item
Dim rowIndex As Long
Dim tempRowIndex, tempColIndex As Long
Application.ScreenUpdating = False
Set myRange = Sheets("Sheet1").Range("SortRangeValue")
rowStartIndex = myRange.Row
colStartIndex = myRange.Column
colCount = myRange.Columns.Count
rowCount = myRange.Rows.Count
Dim tempCal As Long
tempCal = rowCount + rowStartIndex - 2
tempRowIndex = 6
tempColIndex = 200
Range(Cells(rowStartIndex, colStartIndex), Cells(tempCal, colStartIndex)).Copy Destination:=Range(Cells(tempRowIndex, tempColIndex), Cells(tempRowIndex + tempCal, tempColIndex))
For iIndex = 0 To rowCount - 3 Step 1
For jIndex = 0 To rowCount - iIndex - 3 Step 1
rowIndex = jIndex + tempRowIndex
current = Cells(rowIndex, tempColIndex)
currentPlusOne = Cells(rowIndex + 1, tempColIndex)
If current > currentPlusOne Then
Cells(rowIndex, tempColIndex) = currentPlusOne
Cells(rowIndex + 1, tempColIndex) = current
End If
Next jIndex
Next iIndex
Dim tempFinalRowIndex, tempFinalColIndex As Long
tempFinalRowIndex = 6
tempFinalColIndex = 201
Dim orgRange, tempRange As Long
For iIndex = 0 To rowCount - 2 Step 1
rowIndex = iIndex + tempRowIndex
tempRange = Cells(rowIndex, tempColIndex)
'MsgBox (tempRange)
For jIndex = 0 To rowCount - 2 Step 1
rowIndex = jIndex + rowStartIndex
orgRange = Cells(rowIndex, colStartIndex)
If tempRange = orgRange Then
'MsgBox ("Match Found : \n (tempRange,orgRange) : (" & tempRange & "," & orgRange & ")")
Range(Cells(rowIndex, colStartIndex), Cells(rowIndex, colStartIndex + colCount - 1)).Copy Destination:=Cells(tempFinalRowIndex + iIndex, tempFinalColIndex)
End If
Next jIndex
Next iIndex
Application.ScreenUpdating = True
Range(Cells(tempFinalRowIndex, tempFinalColIndex), Cells(tempFinalRowIndex + rowCount - 2, tempFinalColIndex + colCount - 1)).Copy Destination:=Range(Cells(rowStartIndex, colStartIndex), Cells(rowStartIndex + rowCount - 2, colStartIndex + colCount - 1))
Range(Cells(tempFinalRowIndex - 1, tempFinalColIndex), Cells(tempFinalRowIndex + rowCount - 2, tempFinalColIndex + colCount - 1)).Delete
Range(Cells(tempRowIndex, tempColIndex), Cells(tempRowIndex + rowCount - 2, tempColIndex)).Delete
End Sub