The Origin Forum
File Exchange
Try Origin for Free
The Origin Forum
Home | Profile | Register | Active Topics | Members | Search | FAQ | Send File to Tech support
 All Forums
 Origin Forum for Programming
 Forum for Origin C
 Copy one cell of a column/row to another sheet

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

Screensize:
UserName:
Password:
Anti-Spam Code:
Format Mode:
Format: BoldItalicizedUnderlineStrikethrough Align LeftCenteredAlign Right Horizontal Rule Insert HyperlinkUpload FileInsert Image Insert CodeInsert QuoteInsert List
   
Message:

* HTML is OFF
* Forum Code is ON
Smilies
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Clown [:o)]
Black Eye [B)] Eight Ball [8] Frown [:(] Shy [8)]
Shocked [:0] Angry [:(!] Dead [xx(] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
cyndi.y.ri Posted - 02/21/2014 : 2:13:00 PM
Origin Ver. and Service Release (Select Help-->About Origin): OriginPro 9.0.0 (64-bit) SR2
Operating System: Windows

First off I want to say I am NOT a programmer. I only do this on an as needed basis.

I have several sheets in a book with 4 columns and one row of data (computed data in Origin). I need to take this data and place rows from each of the different sheets into one sheet of 4 columns and rows of the data to be able to plot. (or I think I do)

Example:

Sheet1

TotalLF / TotalRF / ToltalLP / TotalRP
.39 / .013 / 0 / 17

Sheet2

TotalLF / TotalRF / ToltalLP / TotalRP
.20 / .015 / 1 / 19

Sheet3

TotalLF / TotalRF / ToltalLP / TotalRP
.15 / .021 / 3 / 13

Into Sheet4

LeftFlow / RightFlow / LeftPressure / RightPressure
.39 / .013 / 0 / 17
.20 / .015 / 1 / 19
.15 / .021 / 3 / 13

Thanks for any help I can get.
4   L A T E S T    R E P L I E S    (Newest First)
cyndi.y.ri Posted - 02/25/2014 : 1:31:20 PM
Thank You
greg Posted - 02/25/2014 : 12:52:47 PM
It isn't clear from your post what's wrong. Maybe you should send your project file and script to tech at originlab.com.
By the way, there is an option to make sure the column format is copied as well
format:=1
cyndi.y.ri Posted - 02/25/2014 : 12:14:59 PM
The first row of numbers came out correctly.

JUNE 2002 6/15/2002 0.39 0.13 0 17
3 1/1/2014 0 0 0 0
1 1/1/2014 0 0 0 0
1 1/1/2014 0 0 0 0
1 1/1/2014 0 0 0 0
1 1/1/2014 0 0 0 0
1 1/1/2014 0 0 0

as you can see the rest didn't.

I changed the script to the following to add a couple of rows...

// BEGIN SCRIPT
range rap = [%H];
newsheet cols:=6;
col(1)[L]$ = Label;
col(2)[L]$ = Date;
col(3)[L]$ = LeftFlow;
col(4)[L]$ = RightFlow;
col(5)[L]$ = LeftPressure;
col(6)[L]$ = RighPressure;
loop(ii,1,rap.nlayers - 1)
{
wrcopy iw:=%(rap)$(ii)
ow:=!
c1:=1
c2:=6
r1:=1
r2:=1
dc1:=1
dr1:=$(ii);
}
// END SCRIPT
greg Posted - 02/25/2014 : 11:54:50 AM
You do not need Origin C to do this since LabTalk is sufficient:

// BEGIN SCRIPT
range rap = [%H];
newsheet cols:=4;
col(1)[L]$ = LeftFlow;
col(2)[L]$ = RightFlow;
col(3)[L]$ = LeftPressure;
col(4)[L]$ = RighPressure;
loop(ii,1,rap.nlayers - 1)
{
wrcopy iw:=%(rap)$(ii)
ow:=!
c1:=1
c2:=4
r1:=1
r2:=1
dc1:=1
dr1:=$(ii);
}
// END SCRIPT

The script adds a newsheet to your workbook and copies one row of four columns of data from each of the pre-existing sheets to this new sheet.

With your Workbook active, copy and paste the script to the Command Window and press Enter.

If you need to copy more than one row from each sheet you need to modify the r2 argument (the number of rows to copy) and the dr1 argument (the destination for the next block of data).

The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000