Moonbeam111
Board Regular
- Joined
- Sep 24, 2018
- Messages
- 73
- Office Version
- 365
- 2010
I basically am trying to have column A match Column B exactly. All values in both columns are alphabetically organized but Column B has some extra values I don't want.
In this example, it would delete the cells M and P in column 2 so that both columns have the same values.
I have this code but it doesn't work quite right when I test it.
a | A |
b | B |
c | M |
d | C |
e | D |
f | P |
g | E |
In this example, it would delete the cells M and P in column 2 so that both columns have the same values.
I have this code but it doesn't work quite right when I test it.
Sub Button2_Click()
For Each cell In Range("B2:B478")
If cell = cell.Offset(, -1) Then
Else
cell.delete
End If
Next cell
End Sub