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
 Origin Forum
 Pick specific cells from different worksheets
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

mar_pav

Brazil
2 Posts

Posted - 11/01/2020 :  5:15:07 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Dear,

I would appreciate it very much if someone could help me with the following problem.

I have a workbook with several worksheets and want to create a new one, which will have a column with their rows containing the data from the same specific cell of these worksheets.

I´ve tried to solve this problem creating a new workbook and trying to copy the desired cells using the following command lines, without success:

for (ii=1,ii<=page.nlayers,i++) {
range r1 = [BookName]$(ii)!wcol(2)[31:31];
wcol(1)[$(ii)]=r1;
}

Unfortunately, this code doesn´t work but I do not understand why. Thank you! Marcelo.

Edited by - mar_pav on 11/01/2020 5:18:42 PM

cpyang

USA
1406 Posts

Posted - 11/01/2020 :  7:43:40 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
There are several errors in your code, but here is the code that work:


//assume source in book1 and result in book2
range rdest = [Book2]1!wcol(1);
int nsheets = [Book1]!page.nlayers;

for (ii=1;ii<=nsheets;ii++) {
	range r1 = [Book1]$(ii)!wcol(2);
	rdest[ii] = r1[31];
}



CP
Go to Top of Page

mar_pav

Brazil
2 Posts

Posted - 11/01/2020 :  10:39:01 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Thanks very much, CP!

I see things (and consequently concepts) are mixed up in my code.

Best, Marcelo.
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