Excel Comparing 2 columns removing duplicates
Solved/Closed
Ben
-
May 9, 2010 at 12:49 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 23, 2011 at 02:17 PM
rizvisa1 Posts 4478 Registration date Thursday January 28, 2010 Status Contributor Last seen May 5, 2022 - Mar 23, 2011 at 02:17 PM
Related:
- Excel Comparing 2 columns removing duplicates
- Tentacle locker 2 - Download - Adult games
- Fnia 2 - Download - Adult games
- Euro truck simulator 2 download free full version pc - Download - Simulation
- Feeding frenzy 2 download - Download - Arcade
- Red dead redemption 2 free download - Download - Action and adventure
1 response
rizvisa1
Posts
4478
Registration date
Thursday January 28, 2010
Status
Contributor
Last seen
May 5, 2022
766
May 9, 2010 at 05:21 PM
May 9, 2010 at 05:21 PM
Try this
Sub ClearSameValue() Dim lMaxRows As Long Dim iTempCol As Integer lMaxRows = Cells(Rows.Count, "A").End(xlUp).Row iTempCol = Cells(1, Columns.Count).End(xlToLeft).Column + 1 Cells(1, iTempCol) = "Temp Value" Cells(2, iTempCol).Select ActiveCell.Formula = "=IF(A2=B2,1,0)" Selection.AutoFill Destination:=Range(Cells(2, iTempCol), Cells(lMaxRows, iTempCol)) Rows("1:1").Select If (ActiveSheet.AutoFilterMode = False) Then Selection.AutoFilter Selection.AutoFilter Field:=iTempCol, Criteria1:="=1" Range(Cells(2, "B"), Cells(lMaxRows, "B")).ClearContents ActiveSheet.AutoFilterMode = False Range(Cells(1, iTempCol), Cells(lMaxRows, iTempCol)).ClearContents End Sub
Mar 23, 2011 at 01:51 PM
Mar 23, 2011 at 02:17 PM
2. press ALT + F11
3. Click on isert and insert a new module
4. paste the code
5. Make sure that active sheet is the sheet on which you want this this
6. press function key "F5" to run macro