Copy formulas between cells as Excell does

Posted by: luigggye-fp on 8 September 2017, 2:40 pm EST

  • Posted 8 September 2017, 2:40 pm EST

    Hi,

    I want to build the same functionality as exell about copy the formulas between cells.

    As you can see in this video http://www.screencast.com/t/U8MpkUa4 , I successfuly set a formula in a particular cell, but I can´t copy this formula to the following cells (down) as Excell does.

    Also, I always must to write the cell coordinates (A1-B1), because if I start the formula with '=', I can't  click in other cell to get the coordenates (as Excell does), because the cell with the '=' lost the focus.

    I am sure somebody succesfully built it before, so I will apreciate if anybody can send me the sample code to do it.

    I think (hope) is just a couple of functions to capture events and to place the appropriate data in the target cells properties.

    Thanks in advance,

    Luigggye

    http://www.screencast.com/t/U8MpkUa4

  • Replied 8 September 2017, 2:40 pm EST

    Hello,

    You may set data only property to false while dragging the content of a cell. e.g.

      Private Sub FpSpread1_DragFillBlock(ByVal sender As Object, ByVal e As FarPoint.Win.Spread.DragFillBlockEventArgs) Handles FpSpread1.DragFillBlock
            e.DataOnly = False
        End Sub

    It should also drag the formula with.

     

    Thanks,

  • Replied 8 September 2017, 2:40 pm EST

    Hi,

    Thanks so much, it´s works, now I can drag and drop any formula between cells as excell does.

    Now I want help about this:

    In order to set a formula  "= A1+B1" in the cell C1, I want to follow the same excell steps.

    1) click a cell  C1

    2) write the character "=" in the cell C1 (the formula starts)

    3) click in another cell, for example A1 (the string coordenate "A1" must to be added in the cell C1

    4) write the character "+" in the cell C1

    5) click in another cell, for example B1 (the string coordenate "B1" must to be added in the cell C1

    6) press enter to finish the formula

    I must to have the same functionality as excell.

    Could you help about the functions and properties I must to use to do it?

    There are any sample code available showing this functionality?

    Thanks in advance,

     Luigggye

  • Replied 8 September 2017, 2:40 pm EST

    Hello,

    You may achieve this functionality using FormulaTextBox. You may attach spread to formulatextbox and achieve the desired behavior.  For example:

    FormulaTextBox1.Attach(FpSpread1)

    FpSpread1.AllowUserFormulas = True

     

    Thanks,

     

     

     

  • Replied 8 September 2017, 2:40 pm EST

    Thanks so much, works fine.

    Two additional questions:

    1) There is a way to show help about the available functions in a formula (SUM, MIN, MAX, etc), while I am writting inside a cell (after starting with the character "=") as excell does?

    2 )There is a way to have the available formulas in other languages (spanish, portuguese) ? for example: instead SUM() I would like to have SUMA() or SOMA() corresponding to spanish and portuguese. I want to choose the   language at runtime.

    I have customers in Brasil, Argentina, USA, etc., They are accustomed to using excel in their native languages.

    Thanks in advance,

    Luigggye

     

  • Replied 8 September 2017, 2:40 pm EST

    Hello,

    Help for the formulas is shown only in the FormulaTextbox and not in the Spread Cells. And we don't have available formulas in other languages, however, you would need to implement your own formulas then accordingly because even if we change the regional settings then there is no change on the formulas already implemented in Spread.

    Thanks.

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels