Skip to main content
Announcements
See what Drew Clarke has to say about the Qlik Talend Cloud launch! READ THE BLOG
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 (3)
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!