Guzzlr
Well-known Member
- Joined
- Apr 20, 2009
- Messages
- 982
- Office Version
- 2021
- Platform
- Windows
Hello All.
What I’m trying to accomplish is to have a template, where two columns with numbers. If any two numbers match between the two columns, they will be deleted to find any newly added numbers.
B3 = 547
C62 = 547
The program should delete Cells B3 & C62 because the two numbers match.
Thanks for the help
Code:
Sub Delete_Matching_Numbers()
Dim lastRow As Long
[COLOR=#336600]' Application.ScreenUpdating = False[/COLOR]
[COLOR=#336600]'Find last row in column B[/COLOR]
lastRow = Cells(Rows.Count, "B").End(xlUp).Row
[COLOR=#336633]'Run Program [/COLOR]
If Range("B8") = Range("C8") Then
Rows.Range("B8:C8").Delete
[COLOR=#000000]End If[/COLOR][COLOR=#336600]
' Application.ScreenUpdating = True[/COLOR]
End Sub
What I’m trying to accomplish is to have a template, where two columns with numbers. If any two numbers match between the two columns, they will be deleted to find any newly added numbers.
- The code is where I’m beginning. It works if the two numbers in B8:C8 match.
- Where I need help, is the range of columns B & C should go to row 500.
- If any two numbers match on B & C, then the corresponding cells will be deleted.
B3 = 547
C62 = 547
The program should delete Cells B3 & C62 because the two numbers match.
Thanks for the help
Last edited: