This is the beginning of an important feature but I think something more expansive would be better- instead of "Trim", something more akin to a "Smart Select Range", using similar notation to the $ reference lock, equivalent to full trim only.
The user would be able to optionally input the starting row & column, and a ending/cutoff row and column, and a "row/column" search mode. The function would then find the first row/column of data that *doesn't throw an error to the rest of the function*, bypassing blank rows/columns and bypassing, for example, header rows, if text would make the function err. The range would then extend to either a blank row/column, or, if search hits the cutoff cell first, stop there. If only the ending cell is specified, the function starts looking in that cell and iterates BACKWARD.
Then, non-function notation could be
".A5:G7" for a Smart Range that starts looking in A5 and ends looking in G7
".A5:" for a range that starts looking in A5 and is cutoff by blanks
":.G7" for a range that starts looking in G7, looking BACKWARD, and cutoff by blanks
"A5:.G7" for a range that starts looking in G7, looking backward, and cutoff by A5