| View previous topic :: View next topic |
| Author |
Message |
JoGaBar General User

Joined: 25 Oct 2007 Posts: 7
|
Posted: Mon May 26, 2008 8:20 am Post subject: Copy or Repeat Data o Cell to Range |
|
|
Hi:
I have program in Harbour (some like VFox) and need copy one data or cell repeat to Range, by examle:
Copy "Suc01" in A5:A5000
How can make this ?
Than
Jorge |
|
| Back to top |
|
 |
Tribio General User


Joined: 04 Dec 2007 Posts: 28 Location: Belgium
|
Posted: Wed May 28, 2008 1:58 am Post subject: |
|
|
Meaning something like this?
| Code: | Dim oDoc As Object
Dim oSheet As Object
Dim iCounter As Integer
Sub CopyTextToRange
oDoc = ThisComponent
oSheet = oDoc.Sheets(0)
For iCounter = 4 to 4999
oSheet.getCellByPosition(0, iCounter).Text = "Suc01"
Next iCounter
End Sub |
|
|
| Back to top |
|
 |
JoGaBar General User

Joined: 25 Oct 2007 Posts: 7
|
Posted: Wed May 28, 2008 6:06 am Post subject: |
|
|
Better like:
Copy "Suc01" to A4:A5000
Need Speed.
But, i not know how.
Regards |
|
| Back to top |
|
 |
Villeroy Super User


Joined: 04 Oct 2004 Posts: 10065 Location: Germany
|
Posted: Wed May 28, 2008 6:17 am Post subject: |
|
|
| Code: |
sheet = thisComponent.Sheets.getByIndex(0)
sheet.getCellByPosition(0,0).setString("Suc01")
range = sheet.getCellRangeByPosition(0,0,0,4999)
range.fillSeries(com.sun.star.sheet.FillDirection.TO_BOTTOM,com.sun.star.sheet.FillMode.SIMPLE,0,0,0)
|
_________________ Rest in peace, oooforum.org
Get help on http://forum.openoffice.org |
|
| Back to top |
|
 |
Tommy27 OOo Advocate


Joined: 18 Nov 2006 Posts: 300
|
Posted: Sat Jul 09, 2011 10:26 pm Post subject: |
|
|
that was exactly what I was looking for.
If someone needs to set other coordinates must consider that A1 is (0,0), B1 is (1,0), C1 is (2,0) and so long... |
|
| Back to top |
|
 |
Tommy27 OOo Advocate


Joined: 18 Nov 2006 Posts: 300
|
|
| Back to top |
|
 |
|