Think i already know the answer to this, but can you use letters instead of numbers in a FOR-Next-LOOP? Tried to get it to work a couple of different ways but couldn't get it, thought i would ask.
FOR I = A to J
CODE'
Next I
Thnak you
Think i already know the answer to this, but can you use letters instead of numbers in a FOR-Next-LOOP? Tried to get it to work a couple of different ways but couldn't get it, thought i would ask.
FOR I = A to J
CODE'
Next I
Thnak you
Re: For-Next-Loop
Hi
If i remember this right, they work if you pu the alphabets in single quotes
Aadarsh
Re: For-Next-Loop
Hi,
If you want letters you will need to modify the syntax.
Using double quotes fails and sinlge quotes act as comments.
[vba]Sub x()
Dim i
For i = Asc("A") To Asc("J")
Debug.Print Chr(i)
Next
End Sub[/vba]
Don’t have an account yet? Register yourself now and be a part of our community!