- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Select a group of cells in a column
Hi, I have table with thousands of rows. I need to be able to select a group of cells in one column, so I could copy it into another table. for example for Column: "Test3 (VOLTS)" only I need to copy cells highlighted in yellow from row 4 thru row 18 using JSL code.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
Here is a simple example of one way to do it
Names Default To Here( 1 );
dt = Open( "$sample_data\big class.jmp" );
// copy the names from row 2-6
NameCpy = dt:name[Index( 2, 6 )];
dt2 = New Table( "copied", New Column( "new name", character ) );
dt2 << add rows( 5 );
// copy to new table
For( i = 1, i <= 5, i++,
dt2:new name[i] = NameCpy[i]
);
If you actually have physical rows that are selected, you can easily get their row number with a:
dt<<get selected rows
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
Thanks that should work, I tried with Big class file.
Much appreciated
Sam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
Hi Jim, how can I select a range of cells withing one column?
for example if I want to select cell 2 thourgh cell 19 within the same column.
Because I want to use this selection to be able to do "Select Matching Cells" within the same column.
Thanks
Sam
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
Here is the example for "Select Matching Cells" taken from
Help==>Scripting Index
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
dt << Select Rows( [1, 2, 3, 4] );
dt << Go To( :Height );
Wait( 2 );
dt << Select Matching Cells();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
Hi Jim, instead of hand picking what cells to select, can I pick a range let's say 2-19?
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
or row 12 thru 40 in column "height"
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Get Direct Link
- Report Inappropriate Content
Re: Select a group of cells in a column
Jim, I figured it out, here is the code it works.
Names Default To Here( 1 );
dt = Open( "$SAMPLE_DATA/Big Class.jmp" );
L = N Rows( dt ); // number of rows
For( i = 3, i <= L, i++,
dt << Select Rows( i, L );
dt << Go To( :Height );
);
Wait( 2 );
dt << Select Matching Cells();