rahulpriyadarshi3785
New Member
- Joined
- Apr 1, 2020
- Messages
- 7
- Office Version
- 2016
- Platform
- Windows
I am new to VBA.
Currently I am using this,
lastColumn is last column of worksheet.
lastRow is last row of worksheet.
It is working fine for:
ActiveSheet.Range(Cells(1,1), Cells (lastRow,lastColumn)). RemoveDuplicates(Columns:=Array(1,2,3), Headers:=xlNo)
- But it will work only for 3 columns each time.
I want to remove duplicate rows from Excel worksheet by making Array dynamically.
MyArray=Evaluate ("Row(1:" & lastColumn & ")")
ActiveSheet.Range(Cells(1,1), Cells (lastRow,lastColumn)). RemoveDuplicates(Columns:=myArray, Headers:=xlNo)
But getting"invalid procedure call or argument" error.
Is there any possible way to do it for a header/ non-header spreadsheet?
Currently I am using this,
lastColumn is last column of worksheet.
lastRow is last row of worksheet.
It is working fine for:
ActiveSheet.Range(Cells(1,1), Cells (lastRow,lastColumn)). RemoveDuplicates(Columns:=Array(1,2,3), Headers:=xlNo)
- But it will work only for 3 columns each time.
I want to remove duplicate rows from Excel worksheet by making Array dynamically.
MyArray=Evaluate ("Row(1:" & lastColumn & ")")
ActiveSheet.Range(Cells(1,1), Cells (lastRow,lastColumn)). RemoveDuplicates(Columns:=myArray, Headers:=xlNo)
But getting"invalid procedure call or argument" error.
Is there any possible way to do it for a header/ non-header spreadsheet?