Luis,
The reason the "-1" in the SelectRow statement puts the selection back
to the original cell is because the default for the RowRelative option
of the SelectRow method is "true". Therefore the ID value of tRow is no
longer absolute but relative to the first task (i.e the beginning). Set
the RowRelative option to "false" and the "-1" isn't needed. Be aware
also that the ID number is absolute but the SelectRow method applies to
the current active view. For example, set a filter that removes a task
somewhere between the beginning and the original selected task in the
current view and run the code (e.g. select task ID 10 and set a filter
to remove task 5 from the current view). Run the code and note which row
is selected now.
John