Re: Inhalt Transportieren & Gruppieren
Verfasst: Di, 03.11.2009 15:02
deutsches Forum rund um Apache OpenOffice und LibreOffice
https://oooforum.de/
Code: Alles auswählen
Sub strans
with thisComponent.sheets(0) '1.Tabellenblatt
rows = .getrows
z = 0 'ab Zeile 1
do while .getcellbyposition(0,z).string <> ""
'solange in Spalte A etwas steht-
c = 3 'Startindex Zielspalte setzen
do while .getcellbyposition(0,z).string = .getcellbyposition(0,z+1).string
'solange in A n gleicher Inhalt wie A (n+1)
.getcellbyposition(c,z).formulalocal = .getcellbyposition(1,z+1).string
' ↑'Spalte B und Spalte C ↓ werden nach rechts oberhalb kopiert
.getcellbyposition(c+1,z).formulalocal = .getcellbyposition(2,z+1).string
c = c+2 'Zielindex wird weitergezählt
rows.removebyindex(z+1,1) 'Quellzeile wird entfernt
loop
z= z+1 'ZeilenIndex Zielzeile hochzählen.
loop
end with
end sub