Hi, I am writing a program in excel VBA where I want to write two for loops together. For example,
For x = 1 to 10 and For y = 1 to 10
do something ...
Next
But if I write "and" between two for statements the program shows error. If I put : between the for statements or write them separately in different lines then the program works in a different way which I don't want. What I want is for x =1, y should also be 1, for x =2, y should be 2 and so on. How can I do that? Please help. Thanks!
For x = 1 to 10 and For y = 1 to 10
do something ...
Next
But if I write "and" between two for statements the program shows error. If I put : between the for statements or write them separately in different lines then the program works in a different way which I don't want. What I want is for x =1, y should also be 1, for x =2, y should be 2 and so on. How can I do that? Please help. Thanks!