Hello,
I have a excel file generated from the access which i am formatting via excel automation. Requirement is to check if each cell value is repeated in column E. If it is, then I need to clear the contents of Column C leaving the first one.(see below)
Column C Column E
abc 1234
cde 678
cde 678
jkl 890
abc 1234
Final result:
Column C Column E
abc 1234
cde 678
678
jkl 890
1234
Here is my attempt: I tried to use match function but it looks like it doesnot work in access.How do i achieve this?
Code:
lstRow2 = .Application.Cells(.Rows.Count, "E").End(xlUp).Row
Debug.Print "lastRow:" & lstRow2
Set .Application.frstRow = 3
Do Until lstRow2 = frstRow
If .Application.Rows("lstRow2:5") = " " Then
lstRow2 = lstRow2 - 1
ElseIf (Match(.Application.Cells(lstRow2, 5), "E3:ElstRow2", 0)) = "YES" Then
.Application.Cells(lstRow2, 4).ClearContents
lstRow2 = lstRow2 - 1
End If
Loop