private sub cWsRmveDupsAcctCodeCol( fWSName as string )
dim owSAcct as object
dim owSSmmy as object
dim owSSmmyColA as object
dim oCsr as object
dim oCritRange as object
dim oDataRange as object
dim oFiltDesc as object
dim oCopyTo as object
Dim oFilterFld(0) As New com.sun.star.sheet.TableFilterField
Dim oFilterDesc AS Object
dim cSummaryIdx as integer
dim cSummaryRows as long
dim cSummaryCols as long
dim cSMOutputTo as object
set owSSmmy = ThisComponent.Sheets.getbyname( fWSName )
set oCsr = owSSmmy.createCursor( owSSmmy )
oCsr.gotoEndOfUsedArea( True )
cSummaryRows = oCsr.RangeAddress.EndRow
cSummaryCols = oCsr.RangeAddress.EndColumn
set owSSmmyColA = owSSmmy.getCellRangeByPosition( c0, c0, c0, cSummaryRows )
FilterColA:
oFilterDesc = owSSmmy.createFilterDescriptor( True )
oFilterDesc.IsCaseSensitive = False
oFilterDesc.SkipDuplicates = True
oFilterDesc.UseRegularExpressions = False
oFilterDesc.SaveOutputPosition = False
oFilterDesc.Orientation = com.sun.star.table.TableOrientation.ROWS
oFilterDesc.ContainsHeader = False
oFilterDesc.CopyOutputData = True
cSMOutputTo = oFilterDesc.OutputPosition
cSMOutputTo.Sheet = 2
cSMOutputTo.Column = 5
cSMOutputTo.Row = 0
oFilterDesc.OutputPosition = cSMOutputTo
oFilterFld(0).Field = 0
oFilterFld(0).IsNumeric = False
oFilterFld(0).Operator = com.sun.star.sheet.FilterOperator.NOT_EMPTY
oFilterDesc.setFilterFields(oFilterFld())
owSSmmy.filter(oFilterDesc)
set oCsr = nothing
set owSSmmy = nothing
set owSAcct = nothing
end sub
Ive spent most of my time tinkering with the FILTER() method, and I can;t get it to work. But having read thru your ods code, a thought occurred to me. Maybe an easier way to approach the problem. two sweeps of the range. first, to identify dups, second to delete them. This approach also suits as the end result is still on Column A. From the Filter() method, it would appear that i need to copy the results somewhere else.
Thx for your reply.