a standard loop in Excel VBA goes like this:
dim i as integer
for i = 1 to 100
<do program>
next
end sub
Now, my question is: how can I use the counter, i, as an argument in the program?
example:
dim i as integer
for i = 1 to 100
If Range("Ci") = 0 Then
Rows("i:i").Select
Rows.Delete
next
end sub
You should be able to do something like this:
The
&is the concatenation operator which is used to add a string onto another string.Now
iis obviously a number in the above example, but VBScript is smart enough to know what you’re doing and, for example, just stick"C"and the current value ofitogether.