Here’s the solution you’re looking for, with all the details.
You cannot get the currently visible row that would respect sorting (or filtering if it’s a master table and not a view), but you can sort with external controls and use their value to also calculate row position.