Origin Ver. and Service Release (Select Help-->About Origin): 9.0.0G SR2
Operating System: Windows 7 64bit
Hello everybody.
I have one worksheet which is structured like the following example
newWSname1 - Info - Data - Data - Data
newWSname2 - Info - Data - Data - Data
newWSname2 - Info - Data - Data - Data
newWSname2 - Info - Data - Data - Data
newWSname2 - Info - Data - Data - Data
newWSname1 - Info - Data - Data - Data
newWSname1 - Info - Data - Data - Data
i found a script online which does the split almost perfect to
newWSname1
Info - Data - Data - Data
Info - Data - Data - Data
Info - Data - Data - Data
newWSname2
Info - Data - Data - Data
Info - Data - Data - Data
Info - Data - Data - Data
based on those splitted newWorksheets, i built some graphs.
my Problem now is, if i change the Data in the first worksheet and want to update it to the existing newWorksheets, the script deletes every existing newWSname# and creates new ones. Now the graphs won't work anymore.
I tried to modify the code, so if the newWSname# already exists, only the cells will be deleted and filled again with new data.
I know, that there is a solution, but i don't know how to do it.
May you help me?
in a short way i need a script that does:
1. get every different "newWSname#"
2. if newWSname# worksheet exists, update existing
else create newWSname'
the script i found:
// Data range to perform discrete frequency count
range makeCol = !col(Zugfamilie);
// Worksheet to be extract
range sourceWks = !;
// Clear worksheets
int sheetNum = page.nlayers;
int colNum = wks.ncols-1;
if (sheetNum>1)
{
for (jj=2; jj<=sheetNum; jj++)
{
layer-d 2;
}
}
// Tree variable to hold discfreqs outputs
tree tr;
// Perform discrete frequency count
discfreqs irng:=makeCol rd:=tr;
// String array to get result from tree
StringArray sa;
sa.Append(tr.FreqCount1.Data1);
if(sa.GetSize() != NANUM )
{
// Loop to extract data
for (ii=1; ii<=sa.GetSize(); ii++)
{
string sn$ = sa.GetAt(ii)$;
// Extract condition string
string cond$ = "makeCol$ = " + sn$;
// Create worksheet with different Make name
newsheet name:=sn$ cols:=colNum outname:=on$
active:=0;
// Extract data
wxt test:=cond$ iw:=sourceWks c2:=colNum ow:=on$;
}
}
is there also the possibilty to create graphs automatically?
as you can see, every worksheet looks the same, so the graphs will be identic too.
But to create 100graphs by hand ...
Thank you for support!