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
 Set As for multiple selected 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

AKazak

Russia
1205 Posts

Posted - 04/28/2020 :  2:10:59 PM  Show Profile  Edit Topic  Reply with Quote  View user's IP address  Delete Topic
Origin Ver. and Service Release (Select Help-->About Origin):
OriginPro 2019b (64-bit)
9.6.5.169

Operating System: W7 Pro x64 SP1

Greetings!

I have a workbook with many sheets of imported data and want to designate the columns in batch.
It seems that GUI doesn't allow us to do this, doesn't' it?
Is a macro the only option?

Thank you.

nick_n

Finland
125 Posts

Posted - 04/29/2020 :  02:26:33 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Hi,
Yes. For looping over objects see:
https://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs#Looping_over_Workbooks_and_Worksheets

Nikolay
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/29/2020 :  05:15:49 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by nick_n

Hi,
Yes. For looping over objects see:
https://www.originlab.com/doc/LabTalk/guide/Looping-Over-objs#Looping_over_Workbooks_and_Worksheets

Nikolay



Great, thank you for suggesting this!
I will create a script and post it here.
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/30/2020 :  1:41:35 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by AKazak
Great, thank you for suggesting this!
I will create a script and post it here.




int ncols = wks.ncols;
string WorkBookName$ = %H;
string SheetName$ = wks.name$;

for(int iC = 1; iC <= ncols; iC += 1)
{
	range TargetColumn = [WorkBookName$]%(SheetName$)!col($(iC));
	TargetColumn.type = 2; // https://www.originlab.com/doc/LabTalk/ref/Wks-Col-obj

Go to Top of Page

nick_n

Finland
125 Posts

Posted - 04/30/2020 :  2:08:16 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
Great. But usually "iC++", easy to read and write.

Nikolay
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 04/30/2020 :  6:25:12 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by nick_n

Great. But usually "iC++", easy to read and write.

Nikolay



What is iC++?
Please share the corresponding hyperlink.
Go to Top of Page

cpyang

USA
1406 Posts

Posted - 04/30/2020 :  7:57:19 PM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
What Nikolay is saying is that programmers coming from C/C++ like to write i++ instead of i+=1, that's all, it is entirely a matter of coding habit.

CP
Go to Top of Page

AKazak

Russia
1205 Posts

Posted - 05/01/2020 :  03:26:15 AM  Show Profile  Edit Reply  Reply with Quote  View user's IP address  Delete Reply
quote:
Originally posted by cpyang

What Nikolay is saying is that programmers coming from C/C++ like to write i++ instead of i+=1, that's all, it is entirely a matter of coding habit.

CP




OK, I see.
I also code C/C++ by the way.
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