created a macro which solves the problem.
this macro helps a lot while we are comparing and analysing huge data.
Macro:
Sort Macro
Sub SortData() 'Sort all the data in this book based on this column in ascending order.
'once sorted, go to the first cell of data in this column.
iDepth = iDepth + 1
iDepth = 1
Call FinalizeMacro
Call InitializeMacro 'Suspend screen updating & autocalculation & save current statusbar setting.
Call LogUsage("Conversions", "SortData") ' Log the use of this macro
Range("A1", ActiveSheet.Cells.SpecialCells(xlLastCell).Address()).Sort Key1:=Range(ActiveCell.Address), Order1:=xlAscending, Header:= _
xlYes, OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveCell.EntireColumn().End(xlUp).Offset(1, 0).Select
Call FinalizeMacro 'Restore screen updating & autocalculation & reset previous statusbar setting.
iDepth = iDepth - 1
End Sub
Function FinalizeMacro()
If iDepth = 1 Then
Application.StatusBar = False
Application.Calculation = xlCalculationAutomatic
Application.DisplayStatusBar = bOldStatusBar
Application.ScreenUpdating = True
End If
End Function
Function InitializeMacro()
If iDepth = 1 Then
Application.Calculation = xlCalculationManual
bOldStatusBar = Application.DisplayStatusBar
Application.ScreenUpdating = False
End If
End Function
Public Sub LogUsage(sMacroSheet As String, sMacroName As String)
' Close #1: Open "c:\DataServMacroUsageReport.txt" For Append As #1: Print #1, Application.UserName & vbTab & macroSheet & vbTab & macroName & vbTab & Now: Close #1
End Sub