When you do a for loop in Excel VB, how do you specify that the parameter is a number in the code. More especifically, suppose I want to open 500 files, named as file1, file2, file3, ... how do you specify in the following code that "i" is a number, not a letter???
Sub CopyCells() For i = 1 To 500 Workbooks.Open Filename:="filei.do" Next i End Sub
I don´t know any Excel VB; I know how to program in Stata much better. My problem is that I have 500 excel files that I have to format and save before I can export to Stata without problem. To do that, I wrote a VB code. All is working well, except a for loop, because I don´t know how to say that "i" is a number, not the letter i. In Stata all you do is to write `i'.