Search code examples
excelc#-4.0spreadsheetgear

Reference another sheet in Formula string SpreadSheetGear


As the questions states, I'm trying to reference some cells from one sheet to another. In one sheet I have the Data to populate some other cells in my Principal sheet

In short: DataSheet > Feeds > PrincipalSheet

I'm trying something like:

"=Data!$A$1"

I've even tried something like:

 "=[Book1]Data!$A$1"

But still, I can't find the correct code.

I have SpreadSheetGeat 2010 and using C#

Thanks in advance for the help you provide!!


Solution

  • Find the answer, actually, the formula is OK, I was generating the cell ranges with some manual, over the top code, and all that I needed was to put

    MySheet.Cells[add ranges here].Range.ToString();
    

    With this code, SpreadSheet generates automatically in which range you are on in this format : "=[Book1]Data!$A$1", and is based on the range that you put in .Cells[],