Problems with copying Formula from one row to another

Hi ,

I am trying to copy the formula from one row of the sheet to second row of the same sheet. But instead of copying the formula relatively to cell position, the same formula from row one is copied.

I.e. Copying "=A1*B1" in row1 should be copied as ="A2*B2" in row2.

I have attached the formula file whose "CI" sheet contains formula & I m trying to copy formula in row 2 to row 3.

Below is the code snippet I am using

--------------

Workbook formulaWorkBook = new Workbook();

formulaWorkBook.open("C:\\temp\\TEST_Formula.xls");

Cells sourceCells = formulaWorkBook.getWorksheets().getSheet("CI").getCells();

sourceCells.copyRow(sourceCells,1,2);

formulaWorkBook.save("c:\\temp\\OutputFile.xls");

--------------

Please advice.

Hi,

Please try the fix in #71993

Hi Warren,

I tried the fix given by you in other forum & it worked to copy 'MOST' of the formulas.

But one of the formulas in Header 'Product Type'(Column N) wasn't copied correctly.

The formula was copied from "=IF(ISBLANK(DATA!$B51),"",VLOOKUP(DATA!A51,ProductMap!$A$1:$B$31,2,FALSE))" as "=IF(ISBLANK(DATA!$B52),"",VLOOKUP(DATA!A52,ProductMap!$A$2:$B$1,2,FALSE))" in the second row.

But the valid formula copy should have been "=IF(ISBLANK(DATA!$B52),"",VLOOKUP(DATA!A52,ProductMap!$A$1:$B$31,2,FALSE))"

The difference has been highlighted. Please let me know if that can be handled.

Thanks,

Hi,

We will fix it.But it will take us 1-2 days to do it.

Hi,

Please try this fix.

Thanks Warren,

This has resolved all my Formula copy issues.

Thanks,

Rohit