Microsoft Office Tutorials and References
In Depth Information
Generating a Unique List
Else¶
'Check both names¶
If LCase$(ActiveWorkbook.Sheets(i).Name) < _¶
LCase$(ActiveWorkbook.Sheets(j).Name) Then¶
'Need to move it¶
ActiveWorkbook.Sheets(j).Move _¶
Before:=ActiveWorkbook.Sheets(i)¶
End If¶
End If¶
Next j¶
Next i¶
ActiveWS.Activate¶
'Restore screen updating¶
Application.ScreenUpdating = True¶
End Sub¶
Exl
There is one variable that can be changed in this workbook: change the sort
order from ascending to descending depending on your needs. To do this,
change the Ascending variable from True to False. This can be done via cell B1
of the example file.
Tip: The macro will still work if the user selects only some of the sheets to sort, as long as they
are next to one another (contiguous).
Generating a Unique List
Using a given range, this macro creates a subset containing only the unique
records within it.
Example file:
E005.xls
Scenario: Whenever there is a database or a list of records,
such as inventory parts, customer information, employee
information, or account numbers, obtaining a unique list to
perform analysis of the data is often required.
 
Search JabSto ::




Custom Search