With Xray I found not only createSearchDescriptor in a range, but also
createSortDescriptor. However, I can't find any information anywhere
about how to use it. The Search thing is easy and II use it all the
time, like this:
Dim oDescriptor As Object, oFound As Object, oRange As Object
oRange=ThisComponent.getSheets().getByIndex(0).getCellRangeByPosition(0,0,3,100)
oDescriptor=oRange.createSearchDescriptor()
With oDescriptor
.SearchBackwards=False
.SearchByRow=False
.SearchCaseSensitive=True
.SearchRegularExpression=False
.SearchSimilarity=False
.SearchString=LTrim(Str(Number))
.SearchStyles=False
.SearchType=1 ' Söker i cellvärden. 0=Söker i formler.
.SearchWords=True
End With
oFound=oRange.findFirst(oDescriptor)
When I look for the corresponding way to sort, I find nothing like
this. Every place I looked, they solved it with quite a different
method.
What I want to do is something like this:
Dim oDescriptor As Object, oRange As Object
oRange=ThisComponent.getSheets().getByIndex(0).getCellRangeByPosition(0,0,3,100)
oDescriptor=oRange.createSortDescriptor()
With oDescriptor
.Something=SomethingElse
.AnotherThing=Whatever
End With
oRange.Sort
Is it possible to sort this way? If it is, my problem is that I didn't
find what I should include within the With statement.
Other solutions I found was a lot harder to follow and looked pretty
uggly. The reason why I want to solve it ”my” way, is that it looks
good and very few comments (REM) are needed. Since I never saw anybody
doing this, I guess it's impossible, but why?
Kind regards
Johnny Rosenberg
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]