von F3K Total » Fr, 12.04.2013 19:07
Moin,
wenn Du die Tabelle siehst, kannst Du dieses Makro nehmen:
Code: Alles auswählen
Sub S_insertprefix
osheet = thiscomponent.currentcontroller.activesheet
ocursor = osheet.createcursor
ocursor.gotostartofusedarea(false)
orangeaddress = ocursor.rangeaddress
nStartColumn = orangeaddress.StartColumn
nStartRow = orangeaddress.StartRow
ocursor.gotoEndofusedarea(false)
orangeaddress = ocursor.rangeaddress
nEndColumn = orangeaddress.EndColumn
nEndRow = orangeaddress.EndRow
orange = osheet.getcellrangebyposition(nStartColumn,nStartRow,nEndColumn,nEndRow)
aformulaarray = orange.formulaarray
aheader = aformulaarray(0)
for i = 1 to ubound(aformulaarray)
arow = aformulaarray(i)
for k = 0 to ubound(aheader)
scell = aheader(k) & ": " & arow(k)
arow(k) = scell
next k
next i
orange.setformulaarray(aformulaarray)
msgbox "fertig"
End Sub
Gruß R
EDIT: Dauert auf meinem Rechner bei 300 Spalten und 1000 Zeilen etwa 13 Sekunden.
Moin,
wenn Du die Tabelle siehst, kannst Du dieses Makro nehmen:
[code]Sub S_insertprefix
osheet = thiscomponent.currentcontroller.activesheet
ocursor = osheet.createcursor
ocursor.gotostartofusedarea(false)
orangeaddress = ocursor.rangeaddress
nStartColumn = orangeaddress.StartColumn
nStartRow = orangeaddress.StartRow
ocursor.gotoEndofusedarea(false)
orangeaddress = ocursor.rangeaddress
nEndColumn = orangeaddress.EndColumn
nEndRow = orangeaddress.EndRow
orange = osheet.getcellrangebyposition(nStartColumn,nStartRow,nEndColumn,nEndRow)
aformulaarray = orange.formulaarray
aheader = aformulaarray(0)
for i = 1 to ubound(aformulaarray)
arow = aformulaarray(i)
for k = 0 to ubound(aheader)
scell = aheader(k) & ": " & arow(k)
arow(k) = scell
next k
next i
orange.setformulaarray(aformulaarray)
msgbox "fertig"
End Sub[/code]
Gruß R
[color=#FF0000]EDIT:[/color] Dauert auf meinem Rechner bei 300 Spalten und 1000 Zeilen etwa 13 Sekunden.