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


Joined: 23 Dec 2004 Posts: 11
|
Posted: Wed Jul 20, 2005 1:24 am Post subject: inserting rows in table: how to get Index? |
|
|
Hello there!
I have: table and tableCursor:
| Code: | [...]
oTable = oResult.TextTable
oTableCursor = oTable.createCursorByCellName(oResult.cell.cellName)
oRows = oTable.getRows()
|
And now I want to insert some rows below the one I am currently in. The problem is method:
oRows.insertByIndex( long nIndex, long nCount )
How can I get nIndex? All I have is: oTable.cell.cellName, but it is String like A1, B8, W4... How can I convert from this Range to nIndex of row or column? |
|
| Back to top |
|
 |
SergeM Super User

Joined: 09 Sep 2003 Posts: 3211 Location: Troyes France
|
|
| Back to top |
|
 |
pitonyak Administrator


Joined: 09 Mar 2004 Posts: 3622 Location: Columbus, Ohio, USA
|
Posted: Wed Jul 20, 2005 11:55 am Post subject: |
|
|
You can use a cursor to obtain the range name and you also claim to know a Cell name. You can easily parse the name to obtain the row number. In a text table, it is pretty safe to assume that there are less than 26 columns, so the following should work:
| Code: | s = "B23"
Print CInt(Right(s, Len(s)-1))
|
You need different code, of course, if therer are more than 26 columns. I might show code in my book to handle this, I would need to check. _________________ --
Andrew Pitonyak
http://www.pitonyak.org/oo.php |
|
| Back to top |
|
 |
|