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
Username:
Password:
Save Password
Forgot your Password? | Admin Options

 All Forums
 Origin Forum for Programming
 LabTalk Forum
 Copy comment cell of several sheets from one book
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

w.eisen

2 Posts

Posted - 01/27/2009 :  08:42:04 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. 8G SR2 v8.0891
Operating System: WinXP

Hi,
I imported 31 data sheets into one Book (one sheet for each day of a month).
The comment line contains the file name aka. the date.

range a = [Book2]Sheet18!Col(B);
range b = [Book1]A18!Col(B);
b = a * (some function);


Now I want to copy these comment lines into another book with 31 sheets, to assign the right date to the data columns in the comment lines in Book2:

I tried this

range c = [Book2]sheet1!col(B)[Co]
range d = [Book1]A31!col(B)[Co]
c=d;

[Co] = Comment

It didnt work...

Can someone help?

greg

USA
1379 Posts

Posted - 01/27/2009 :  10:32:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
While defining a range to include just a particular header row appears to work (that is Origin does not complain), you cannot work with that range. To get this working, you only need to leave out the header row notation in the range definition and only use it when you reference the header for that range. So this should work:

range c = [Book2]sheet1!col(B);
range d = [Book1]A31!col(B);
c[C]$ =d[C]$;

It isn't clear from the above whether data and header are supposed to stay together, but you might look at the 'colcopy' X-Function which can copy both.
Go to Top of Page

w.eisen

2 Posts

Posted - 01/27/2009 :  11:02:50 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Very nice hint! The 'colcopy' Function was what i was actually looking for.

Thx al lot!
Go to Top of Page
  Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
The Origin Forum © 2020 Originlab Corporation Go To Top Of Page
Snitz Forums 2000