Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

calculate irr in table box

hi all,

i am able to read my table using macro -

Sub ReadStraightTable

Set Table = ActiveDocument.GetSheetObject( "CH05" )

For RowIter = 1 to table.GetRowCount-1

   For ColIter = 2 to table.GetColumnCount-1

        set cell = table.GetCell(RowIter,ColIter)

        MsgBox(cell.Text)

    Next

Next

End Sub

now i want to calculate irr in table box but im not getting how to pass table values from macro above to the table box properties to calculate irr. any help would be thankful.

25 Replies
Clever_Anjos
Employee
Employee

It would be easier without a macro

Which expression is inside your CH05 object?

Not applicable
Author

yes but i want to get it done by macro. it should work like the macro will copy values from chart into a variable and then that variable can be used in text box.

the table is holding values which are not static , they are dynamic i.e. value keeps on changing.

Clever_Anjos
Employee
Employee

Maybe someone can help you with your macro so.

Good luck

Not applicable
Author

clever can you help me with how to script in macro to copy values from chart to a variable??

tamilarasu
Champion
Champion

Hi Skid,

How you want to store the values in variable.? I have not used this before, so any expected output will be helpful for me to help you further.

Clever_Anjos
Employee
Employee

Use SetContent method

set v = ActiveDocument.Variables("yourvar")

v.v.SetContent "0", True

Anil_Babu_Samineni

Try to avoid Macro. First try to solve the problem with Clever solution or else someone help you

Best Anil, When applicable please mark the correct/appropriate replies as "solution" (you can mark up to 3 "solutions". Please LIKE threads if the provided solution is helpful
Not applicable
Author

hello Nagraj

this is the link what im looking to do. I have a table with that changes so want to read straight table by macro and then have to pass it to varaible so i can create a text box to calculate irr. for reading from table i used macro code as -

Sub ReadStraightTable

Set Table = ActiveDocument.GetSheetObject( "CH05" )

For RowIter = 1 to table.GetRowCount-1

   For ColIter = 2 to table.GetColumnCount-1

        set cell = table.GetCell(RowIter,ColIter)

        MsgBox(cell.Text)

    Next

Next

End Sub

this gives me the reading of table only, now i want this table values to be given to a variable so i can proceed further.

thanks for ur reply

Not applicable
Author

it cannot be done without macro.