Getting the current selected cell is simple to do with the command:
PV GET CURRENT CELL (area; column; row)
The command PV GET CURRENT CELL returns the coordinates of the current cell of area in the column and row parameters.
Getting the current selected range of cells is a little trickier:
The command to use is PV GET SELECTED RANGES LIST (area; left; top; right; bottom)
The command PV GET SELECTED RANGES LIST gets, in arrays passed as parameters(left; top; right; bottom), the coordinates of the selected ranges in area.
Let's look at an example:
If we select the following cells
we would end up with, as the first element in the arrays, the following numbers.
left{1}=1
top{1}=1
right{1}=2
bottom{1}=3
You'll notice the coordinates pinpoint the first cell (1,1) and the bottom, right cell (2,3), with which we can identify the selection.