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

Joined: 29 Mar 2007 Posts: 25
|
Posted: Sun Sep 21, 2008 5:10 am Post subject: Finding last row of a data set in range |
|
|
Hi all,
I am writing a macro to do a sort and delete of rows on a report. I can sort and delete rows OK, but I am having a problem finding how to get the last row of a particular data set in a range.
I have a column in a range with 3 different values, say, David, Peter and Paul I do a sort on this column and want to delete all the rows with Peter and Paul in them. I have the number of the last row of the complete data set, but can't figure out how to find the last row of the data set with David in them.
I could do a loop, but this would take too much time and the report has many rows.
Any help would be greatly appreciated. _________________ www.sun.com |
|
| Back to top |
|
 |
Krypton General User

Joined: 29 Mar 2007 Posts: 25
|
Posted: Sun Sep 21, 2008 10:49 pm Post subject: |
|
|
Anyone?
 _________________ www.sun.com |
|
| Back to top |
|
 |
Krypton General User

Joined: 29 Mar 2007 Posts: 25
|
Posted: Mon Sep 22, 2008 1:55 am Post subject: |
|
|
Panic over.
I used the match formula. One thing that annoys me is that I don't know how to access it without creating it in a cell, and then referencing that cells value. My code is as follows
| Code: |
oMatch = osheet.getcellrangebyName ("AL1")
oMatch.formula = "=MATCH(""Peter"";AK$1:AK$8440)"
oend = oLastCell.endrow - omatch.value
oSheet.getRows().removeByIndex(omatch.value, oend) |
_________________ www.sun.com |
|
| Back to top |
|
 |
|