How to display text across sheets in TAdvSpreadGri


I'm trying to display the contents of a cell on sheet1 in a cell on sheet2. The cell in sheet1 contains a string. The code below displays the cell contents in sheet2 as a 0, as if the cell in sheet1 was being evaluated as an integer.

I'm using the code

sheet1.Cells[1,1] := 'test';

sheet2.Cells[1,1] := 'sheet1!A1';

Has anyone any idea why this doesn't work?


Jonathan Martin

Sorry, it is by design that cell text is contained to the cell rectangle and can't cross its borders. If cell text is wider than a cell, you could use cell merging or you could use cell hints that will have the text appear in a hint as the mouse hovers the cell.

Thanks Bruno!

Can I just clarify this though? What I'm saying is that if I write the code

sheet1.Cells[1,1] := 'test';

sheet2.Cells[1,1] := 'sheet1!R1C1';

sheet1 cell R1C1 contains the value 'test'

sheet2 cell R1C1 contains the value '0.00'.

Do I take it that there is no way to show a text cell in another sheet using in-line formulas and I have to reference the cell in sheet1 using

sheet2.Cells[1,1] := sheet1.Cells[1,1];


Thanks in advance for clarifying this!


Sorry, I misunderstood your question.
With a TGridBinder, it is possible to connect 2 TAdvSpreadSheet instances and refer to cell values in other spreadsheets.
You can download a sample app here: