rainmantwo
New Member
- Joined
- Jun 13, 2002
- Messages
- 45
Is there any way to compare the first 5 characters of ce;l a2 with the frist frive chararcters of c2 and then write a true of false?
If Left(Range("A2"),5)=Left(Range("C2"),5) Then Range("C2").ClearContents
Dim i as Long
For i = 2 to 8000
If Left(Cells(i,"A"),5)=Left(Cells(i,"C"),5) Then Cells(i,"C").ClearContents
Next i
Then you need to write a loop to loop through the range, i.e.
Code:Dim i as Long For i = 2 to 8000 If Left(Cells(i,"A"),5)=Left(Cells(i,"C"),5) Then Cells(i,"C").ClearContents End If
Dim i as Long
For i = 2 to 8000
If Left(Cells(i,"A"),5)=Left(Cells(i,"C"),5) Then Cells(i,"C").ClearContents
Next