Hi I have tried many remove duplicates I found but all remove the formatting.
I did add a vba code to copy paste formatting but sometimes does not work and gives me error
Is there a way to remove duplicates and keep formatting?
Here are two I am trying to use but on this one getting Run time error 1004
Pastespecial method of range class failed
2nd I was using and was working great until yesterday I imported a new CSV file and then stopped.
I removed the
'Dim lastRow As Long
'Dim lastCol As Long
and started working again, then today imported new csv file and getting error run time 1004
Application defined or object defined error
here is the second
I did add a vba code to copy paste formatting but sometimes does not work and gives me error
Is there a way to remove duplicates and keep formatting?
Here are two I am trying to use but on this one getting Run time error 1004
Pastespecial method of range class failed
VBA Code:
ActiveSheet.Range("A:l").RemoveDuplicates Columns:=Array(1, 2, 4, 9, 10), Header:=xlYes
ActiveSheet.Range("A:l").Copy
ActiveSheet.Range("A:l").PasteSpecial xlPasteFormat
ActiveSheet.Range("A:l").PasteSpecial xlPasteValidation
2nd I was using and was working great until yesterday I imported a new CSV file and then stopped.
I removed the
'Dim lastRow As Long
'Dim lastCol As Long
and started working again, then today imported new csv file and getting error run time 1004
Application defined or object defined error
here is the second
VBA Code:
'Dim lastRow As Long
'Dim lastCol As Long
lastRow = Cells(Rows.Count, "A").End(xlUp).Row
lastCol = Cells.Find("*", SearchOrder:=xlByRows, SearchDirection:=xlPrevious)
Range(Cells(1, 1), Cells(lastRow, lastCol)).RemoveDuplicates Columns:=Array(1, 2, 4, 9, 10)
Sheets("transactions").Range("A24000:O24000").Copy
Sheets("transactions").Range("A24001:O" & lastRow).PasteSpecial xlPasteFormats
Sheets("transactions").Range("A24001:O" & lastRow).PasteSpecial xlPasteValidation