I want to add a sequence number to each of these rows the first row always has a 0 for Prev Logical Device and the last row always has a 0 for Next Logical Device. Pretty easy to add the sequence number for the first row. How do I go through a list adding an incremental sequence number for the correct row. You will see that row 1 under the headings is the first row but the next sequence number would actually be row 5. Since the device numbers are not sequential sorting doesn't help except to find the first row. Any help would be appreciated.