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
 Copy selected columns to other worksheet(s)
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic Lock Topic Edit Topic Delete Topic New Topic Reply to Topic

AKazak

Russia
1252 Posts

Posted - 03/21/2026 :  08:52:33 AM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
OriginPro 2026b (64-bit) Beta2 10.3.5.62
Windows 10 Pro

Greetings!

I have a number of worksheets sharing the same structure.
In a single worksheet I add few additional columns with formulas and LT scripts before formula.

What is the best way to copy these extra columns to all the other similar worksheets by insert new columns to the same locations as those of the original columns?

Please see a sample project below:
https://my.originlab.com/ftp/forum_and_kbase/Images/2026-03-21.opju

How do I duplicate column B along with its headers formulas from Sheet1 to all the other sheets?

Thank you.

---
Andrey

YimingChen

1697 Posts

Posted - 03/23/2026 :  2:55:45 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
You may try the script below:


for (int i = 2; i <= page.nlayers;i++) {
	page.active = i;
	wks.col = 2;
	wks.insert();
	range rs = 1!;
	wks.col.formula$ = %(rs.col2.formula$);
	wks.col.lname$ = %(rs.col2.lname$);
}


Yiming
Go to Top of Page

AKazak

Russia
1252 Posts

Posted - 03/23/2026 :  2:58:22 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by YimingChen

You may try the script below:


for (int i = 2; i <= page.nlayers;i++) {
	page.active = i;
	wks.col = 2;
	wks.insert();
	range rs = 1!;
	wks.col.formula$ = %(rs.col2.formula$);
	wks.col.lname$ = %(rs.col2.lname$);
}


Yiming



Got it.
Is there a way to do the same via GUI?

---
Andrey
Go to Top of Page

cpyang

USA
1407 Posts

Posted - 03/24/2026 :  09:02:47 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
We are adding this ability in 2026b to add column to other sheets.
We can work on also Insert support.
Or adding is good enough?




CP
Go to Top of Page

AKazak

Russia
1252 Posts

Posted - 03/24/2026 :  10:03:43 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

We are adding this ability in 2026b to add column to other sheets.
We can work on also Insert support.
Or adding is good enough?




CP




Dear CP,

Add and Insert would be great!
Besides, please implement selection 1+ source columns to paste to the similar worksheets.

---
Andrey
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