Get cell selection in worksheet
X-Function not designed for Auto GetN Dialog.
get_wks_sel str:=selection; // select some columns or cells and then execute
Please refer to the page for additional option switches when accessing the x-function from script
Output
string
Input
Worksheet
This X-Function gets range strings for selections made in the specified worksheet, and outputs the result to a string variable. When there are multiple, non-contiguous selections, the ranges will be separated by the specified separator.
Start with a worksheet and select some columns or range of cells. For non-contiguous selections, hold the CTRL key. Then run this script:
get_wks_sel; // selection gets saved to sel$ int nn=sel.GetNumTokens('|'); // count number of selections for(int ii = 1; ii <=nn; ii++) { strTemp$ = sel.GetToken(ii, '|')$; // get the next selection type Selection# $(ii): %(strTemp$); // type out selection range }