I need help here with Excel VBA.
I want to know how to compare multiple cells in the same row, but in different columns.
I need to compare something like specific cells E3, G3, I3 and find out if any of it are duplicates and remove the duplicate of whichever was put in first.
Note: A drag and drop function is used to fill in the data.
I tried using something like this
Dim R1, R2, R3 As Range
Set R1 = Range("E3")
Set R2 = Range("G3")
Set R3 = Range("I3")
If (R1 = R2 Or R1 = R3) Then
MsgBox "Room Already Used!"
With Application
.EnableEvents = False
.Undo
.EnableEvents = True
End With
End If
But I need to compare even more rows and columns.
