Hello
I’m still trying to copy a line from a sheet to another as explained here.
I think what I see is a bug.
I added to my macro a log which write in the console the formulas fetch by .GetFormula() .
What I see is that:
- “SI” is converted in “IF” (I assume it is normal)
- “;” are converted in “,”
Problem : when you write the formula in cell (with .SetValue(formulas[col])), you get an error message indicating that the separator in the formula is wrong (which is normal).
Is it my javascript knowledge which is limited or is it a bug ?
Is there a temporary workaround or another way to do things ?
Thanks.
Générateur de menus en anglais v2.0.2.xlsx (157.2 KB)
Hello @arcqus
I believe this can be done much easier:
var sheet1 = Api.GetSheet("Principale"); // Getting main sheet from which data will be copied
var sheet2 = Api.GetSheet("Sheet1"); // I've created new empty sheet for to copy data to
var oRange = sheet1.GetRows("12"); // Getting whole row
var oDestRange = sheet2.GetRows("12"); // Setting destination point
oRange.Copy(); // Copying content of the row above
oDestRange.PasteSpecial("xlPasteAll", "xlPasteSpecialOperationNone", false, false); // Pasting all data preserving text, formulas, etc.
Generally, this macro copies all values from row 12 to the same row 12 in new test sheet with name Sheet1.
Relies on methods: GetRows, Copy, PasteSpecial (with default values of sPasteType and sPasteSpecialOperation parameters).
Please check this solution out and let me know if it suits you.
1 Like
A huge thanks @Constantine !!!
I’ve been stuck on this for 3 days (and then on holidays ).
It’s working indeed.
1 Like