Skip to main content
Announcements
Qlik Introduces a New Era of Visualization! READ ALL ABOUT IT
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

Macro to move text box based on selections

Hello,

I have a straight table with financial information and because the user can select one or months/years, the straight table size changes. I have a text box to the right (partially complete) that show 3-Month trends and I was hoping to have this textbox follow the size of the straight table. I have this macro (below) but the edit box keeps popping up when I got to execute. So if the user selects one month, then the textbox will move to a position, if they select two months another position... I only went to month 3 in my macro but I want to end up going out to 11 months.

Textbox ID: TX778

Month Filter: LB39

SUB Move1

set fld=Activedocument.Fields("LB39").Count

if fld=1 then

  set p1 = ActiveDocument.GetSheetObject("TX778")

  set fr = p1.GetFrameDef

  set pos = fr.Rect

  pos.Left = 1000

  p1.SetFrame fr,true, ""

Else

if fld=2 then

  set p1 = ActiveDocument.GetSheetObject("TX778")

  set fr = p1.GetFrameDef

  set pos = fr.Rect

  pos.Left = 2000

  p1.SetFrame fr,true, ""

Else

if fld=3 then

  set p1 = ActiveDocument.GetSheetObject("TX778")

  set fr = p1.GetFrameDef

  set pos = fr.Rect

  pos.Left = 3000

  p1.SetFrame fr,true, ""

End IF

End IF

End IF

End sub

Thank you very much in advance!Qlikview Chart Move.JPG

0 Replies