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
 loop over selected worksheets

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
olsy Posted - 09/19/2011 : 09:06:21 AM
Origin Ver. and Service Release (Select Help-->About Origin): 8.5Pro
Operating System:Win7

Hi guys!
Got a problem: i have a several worksheets in one workbook and number of worksheets can be different. So i need to find a mean value and standard deviation for columns 5-10 in worksheets starting from second and finish before two last...and put results to a specified column in last worksheet.

Who has any idea?
3   L A T E S T    R E P L I E S    (Newest First)
Penn Posted - 09/21/2011 : 9:21:38 PM
Hi,

Please focus on step 3, 4, and 5. Also, an example, which I have told in this thread before, can be referred to. If you want to combine columns from 5 to 10 as one dataset to calculating mean and standard deviation, you can refer to the vector class to handle the vectors derived from step 3.

Penn
olsy Posted - 09/21/2011 : 11:55:30 AM

Thanks Penn!
I manage to figure out how to loop over worksheets but now i donīt understand how to select columns from 5 till 10 and make basic statistics for each of them...it is confusing me.
iīve tried SetRange but it is wrong i guess.

How does it work?
Penn Posted - 09/20/2011 : 03:03:41 AM
Hi,

Maybe you can refer to the following steps:

1. Get the workbook, you can use the WorksheetPage constructor by passing workbook name.

2. Loop all layers contained in the workbook by Layers collection. Then create the worksheet by passing the layer to the Worksheet constructor. You can use the foreach statement.

3. Get Columns collection from worksheet, and then get column data by GetDataObject method. The result vector contains the data for calculating the mean and standard deviation.

4. Calculate the mean and standard deviation by using ocmath_basic_summary_stats function.

5. Put the results to worksheet by SetCells method.

Hope the steps help.

Penn

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