Cell Reference

I'm using the FlexCel API to create a reference to a cell in another sheet (same workbook/file).  I want the value of cell B3 in Sheet1 to be "='Sheet2'!C4".  Here is how I'm doing it now (VB):

Given s2Row  = 4 and s2Col = 3...

xls.SetCellValue(1, 2, 3, New TFormula("='Sheet2'!" & TCellAddress.EncodeColumn(s2Col) & CStr(s2Row)), -1)

Is there a better way?  Thanks in advance.

--
Greg

Hi,

I think that is ok. But if you prefer, you could use:

Thanks, Adrian.  Both work but your suggested way actually makes the code a bit more readable in my opinion.