Determine the columns and rows of a selection

You can iterate through all selected ranges with following method.

CGXRangeList selList;
if (!CopyRangeList(selList, TRUE))
   return;
POSITION pos = selList.GetHeadPosition( );
while (pos)
{
   CGXRange range = selList.GetNext(pos);
}   

If you only want to know the newest selection:

CGXRangeList selList;
if (!CopyRangeList(selList, TRUE))
   return;
CGXRange range = selList.GetTail( );