Hi,
I think this is what you were really asking for...
If you query datawindow.selected using describe you will find the 'black' selected areas. For example "1/11/firstname/lastname/address" if the user has mouse selected those three columns for rows 1 to 11.
In this example, all columns are of type string.
string ls4Clipboard, lsSelected integer lidx long lRow, lRowStart , lRowFinish string lCol[] lsSelected = dw_sheet.Describe ( 'datawindow.selected' ) if pos ( lsSelected , '/' ) = 0 then return 0 if pos ( lsSelected , ';' ) > 0 then lsSelected = left ( lsSelected , pos ( lsSelected , ';' ) - 1) end if lRowStart = long( left ( lsSelected , pos ( lsSelected , '/' ) - 1 )) lsSelected = mid ( lsSelected , pos ( lsSelected , '/' ) + 1 ) lRowFinish = long( left ( lsSelected , pos ( lsSelected , '/' ) - 1 )) lsSelected = mid ( lsSelected , pos ( lsSelected , '/' ) + 1 ) DO WHILE pos ( lsSelected , '/' ) > 0 lidx++ lCol[lidx] = left ( lsSelected , pos ( lsSelected , '/' ) - 1 ) lsSelected = mid ( lsSelected , pos ( lsSelected , '/' ) + 1 ) LOOP if lsSelected <> '' then lidx++ lCol[lidx] = lsSelected end if FOR lRow = lRowStart to lRowFinish for lidx = 1 to UpperBound ( lCol[] ) if not IsNull ( dw_sheet.GetItemString ( lRow , lcol[lidx] )) then ls4ClipBoard += dw_sheet.GetItemString ( lRow , lcol[lidx] ) end if if lidx < UpperBound ( lCol[] ) then ls4Clipboard +='~t' next ls4ClipBoard += '~r~n' NEXT ClipBoard ( ls4Clipboard ) return 1
You will notice that if there are two sets of rows/columns that are mouse selected they are separated by a semicolon: 3/5/col1/col2;7/8/col1/col2/col3
In my script I ignore second selection.
Hope this helps
Lars