» Return unique items using VBA in Microsoft Excel
VBA macro tip contributed by Erlandsen Data Consulting offering Microsoft Excel Application development, template customization, support and training solutions
CATEGORY - Custom Functions , Printing in VBA
VERSION - All Microsoft Excel Versions
You can use the macro like this to copy all the unique items from A2:A100 to cell C1 and below:
FindUniqueValues Range("A2:A100"), Range("C1")
Sub FindUniqueValues(SourceRange As Range, TargetCell As Range)
SourceRange.AdvancedFilter Action:=xlFilterCopy, _
CopyToRange:=TargetCell, Unique:=True
End Sub
Book Store:
Recommended Books:
- The One Page Business Plan: Start With a Vision, Build a Company!
- The Intelligent Investor: The Classic Bestseller on Value Investing
- The McGraw-Hill 36-Hour Course in Finance for Nonfinancial Managers
- Rich Dad, Poor Dad: What the Rich Teach Their Kids About Money--That the Poor and Middle Class Do Not!
- Advanced modelling in finance using Excel and VBA
- The New Financial Order: Risk in the Twenty-First Century
No comments have been submitted.

