This might be a bit much to ask but I\'m wondering if the following is possible. this is all based on my initial question on How do I copy a range of formula values and past
This code works for me (lastrow
based on this asnwer by @SiddharthRout):
Sub test()
Dim lastrow As Long
With ThisWorkbook.Worksheets("Sheet1")
If Application.WorksheetFunction.CountA(.Cells) <> 0 Then
lastrow = .Cells.Find(What:="*", _
After:=.Range("A1"), _
Lookat:=xlPart, _
LookIn:=xlFormulas, _
SearchOrder:=xlByRows, _
SearchDirection:=xlPrevious, _
MatchCase:=False).Row
Else
lastrow = 1
End If
'Array(1, 2, 16) means 1 - for A, 2 for B and 16 for P columns
.Range("A1:P" & lastrow).RemoveDuplicates Columns:=Array(1, 2, 16), _
Header:=xlYes
End With
End Sub