Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Want to see what's currently in public preview? We've pulled it all together in one place. Check it out here
cancel
Showing results for 
Search instead for 
Did you mean: 
arngue
Contributor III
Contributor III

How to create a macro to clear variables using For statement

Hi everyone,

I don't know why this Macro is failing.

 

Sub Clear

    For i = 0 to 19 Step 1
    
        ActiveDocument.Variables("vGroup"&i).SetContent "",true
    
    Next

End Sub

 

Anyone see something wrong?

What I need is to clear variables vGroup from 1 to 19

Labels (2)
1 Solution

Accepted Solutions
m_woolf
Master II
Master II

For loop should start with 1, not zero?

View solution in original post

3 Replies
m_woolf
Master II
Master II

For loop should start with 1, not zero?

albert_guito
Creator II
Creator II

Hi,

Your code is running right for me.

What kind of mistake are you getting for?

Ag+

Ag+
arngue
Contributor III
Contributor III
Author

Sorry, my fault, idiot me...

 

Thanks for Awnsers!