Anyone know how...?

BLeslie88

B Leslie
Local time
Today, 13:45
Joined
May 9, 2002
Messages
228
To do a loop ...

Char = "A"

Do while Char < "L"

Char = ".... next Char ... A , B , C , D , E ... so fourth"
Loop

Char reserved word... I just wanna know how to increment a string single letter. Is it possible.? Ascii maybe...?? Simpler code maybe.
 
My ideal so far...

Char 65-90
= A-Z

So now I just need to loop 65 - 90 ...

Last piece is how to assign ascii value to a variable.

Counter = 65
do while counter <= 90
MyVar = ascii(65) value
' would be "A" which is what I need....
Counter = Counter + 1
Loop
 
Found it.

MyChar = Chr(65) ' Returns A.
MyChar = Chr(97) ' Returns a.
MyChar = Chr(62) ' Returns >.
MyChar = Chr(37) ' Returns %.
 
In what context are you trying to do this?
 
...

Using it for excel. I was formatting columns and wanted to loop through them instead of repeated code for each column...

Anyhow, I cracked it.

I put it here because vba applies to both excel and access so I thought you guys might have an answer... but I solved my own riddle.

Thanks,
 

Users who are viewing this thread

Back
Top Bottom