Author |
Topic  |
|
blt2si
Germany
37 Posts |
Posted - 03/26/2003 : 08:40:55 AM
|
Hello all,
A simple task I am having trouble with. I need to insert a range of cells into a dataset or column shifting the inforamtion to the right! Eg. I have 10 columns (datas1 up to datas10). I want to insert cells from row 4 - 10 into datas5 so that the previous information in these cells gets shifted right to datas6.
I tried using "delete range" with "true" statement bu the data previous is deleted. wks_active.DeleteRange(4,5,10,5,true);
Another question: I am importing information into a worksheet. The information (data) that is imported has a its own heading for each dataset (i.e. N, Force, etc.). The template has the same dataset names. Is it possible to link the two names together so that if the information came in a different order the datasets could be rearranged automatically to fit the template? Could this be done effectively with 60 datasets (columns)? or is it possible to make the headings (1st row) of the information (data) imported as the dataset by renaming the default set (A1, B1, B2, B3....etc).
The reason for this is so I can call on dataset names for plotting and if the information comes from a range of places with mixed up columns then this program can overcome it sorting the data.
Thanks
Blank |
|
easwar
USA
1965 Posts |
Posted - 03/28/2003 : 4:50:22 PM
|
Hi Blank,
The DeleteRange() method that can also be turned into inserting with the flag set to true, only shifts data down within the dataset columns, and not to the right. To do what you are asking for, you will need to write an OriginC function and use the worksheet object to code this kind of shift.
Regarding your second question, if you do want to use a template for the worksheet into which the data should come in, then the solution could be that you bring the (mismatched) data first into a temporary worksheet and then have a program that moves appropriate data from the temp worksheet into appropriate columns of the worksheet created using the template, by matching the dataset names in the two worksheets one by one. For this your import will need to be set up so that the names N, Force etc. are assigned to the datasets at the time of import. If you end up using these strings in the file for your dataset name, then you could also get rid of the template and just do this naming, and then you will be able to refer to the datasets by these names for plotting, computing etc.
Easwar OriginLab.
|
 |
|
|
Topic  |
|
|
|