Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello All,
Is it possible to load a Straight Table cell value into a variable?
Thanks!
Hello and welcome to the Forums,
Rather, you can set the expression you used in the straight table into a variable or in a text object. Say you have a chart showing Country as dimension and Sum(Sales) as expression. If it's one particular value of the dimension what you want to show, create a variable with something like
Sum({< Country = {'ES'} >} Sales)
Hope that helps.
Sorry,
You mean using macros? Then this should work:
Sub GetCell Set st = ActiveDocument.GetSheetObject("CHXX") '' ID of the straight table stc = st.GetCell(1, 2) '' First row second columnEnd Sub
Hope that helps.
Thanks Miguel!
That's what I'm looking for.
And how can I use the 'stc' value outside the Edit Module and include it in an Expression in a TextBox for instance?
I'm a newbie 🙂
Hi,
Glad to help. Try with this
Sub GetCellAndSetText Set st = ActiveDocument.GetSheetObject("CHXX") '' ID of the straight table stc = st.GetCell(1, 2) '' First row second column (including subtotal, if any) Set t = ActiveDocument.GetSheetObject("TXXX") '' ID of the text object t.SetText stc.TextEnd Sub
Hope that helps.
Thanks a lot Miguel!