Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Find Duplicate Values in Excel
Author:
Kishor Raut
E-mail:
Click to e-mail author
Submitted:
3/23/2005
Version:
VB6
Compatibility:
VB6
Category:
Miscellaneous
Views:
29717
'Insert Module Excel's Visual basic Editior, and copy the code and execute macro name FindDuplicate. What is Find Duplicate ? Tips This small macro written by me helps you to find duplicate values in a specified column Duplicate values will be highlighted yellow & bold Conditions required: 1-Data in a given column should be sorted 2-No row should be left blank, in between a specified column Thanks.
Declarations:
'Nothing 'Insert Module Excel's Visual basic Editior, and copy the below code and execute macro name FindDuplicate.
Code:
Sub FindDuplicate() On Error GoTo Merr Dim kr As String COLNAME = MsgBox("This function is developed by Kishor Raut, it finds duplicates values in a specified column.", vbOKOnly + vbInformation, "Find Duplicate") ColNameIn = Trim(InputBox("Enter name of column to find duplicate values e.g. B", "Column Name", "A")) If Len(ColNameIn) = 0 Then Exit Sub Range(ColNameIn & 1).Activate For A = 1 To 65535 Range(ColNameIn & A).Activate If ActiveCell.Value = kr Then ActiveCell.Font.Bold = True Selection.Interior.ColorIndex = 6 Else End If If Len(ActiveCell.Value) = 0 Then MsgBox "Finished Finding, no more data to check after this cell", vbOKOnly + vbInformation, "Kishor:Thanks" Exit Sub End If kr = ActiveCell.Value Next A Exit Sub Merr: MsgBox Err.Description Exit Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement