I'm a beginner on VBA and I'm seeking advice on how to create a macro that can remove duplicate values (by deleting rows) including the original values itself on multiple sheets. In addition, the macro can search for the specific value even though the specific value is listed on different columns. Here is an example of the sheets:
Sheet1
Class People
cs101 12
cs102 13
Sheet2
People Class
12 cs101
15 cs105
Sheet3
Room People Class
key1 12 cs101
key2 16 cs106
In this dataset, I want to remove rows that have identical class codes (cs101) in multiple sheets.
Here is the macro that I have created:
Sub Remove_Duplicates()
Dim Rng As Range
Set Rng = Range("A1:A1048576")
Rng.RemoveDuplicates Columns:=1, Header:=xlYes
End Sub
The issues in this macro are:
- This macro only works on 1 sheet
- This macro removes the duplicates, but not the original value
- This macro can only be used on values that are listed in column A
Thank you for your time!