"counting" through the alphabet

G

Guest

I have a variable (DIM strLetter as string) that should change from A to X
(24 letters) using the same order as the alphabet.

Any suggestions to how I can set this up in my code? Functionality I'm
looking for:

DIM strLetter as string
For strLetter = A to X
Msgbox("strLetter is now: " & strLetter)
next strLetter

Thank you
The Doctor
 
N

Niek Otten

Sub CountChar()
Dim i As Long
For i = 1 To 24
MsgBox ("strLetter is now: " & Chr$(i + 64))
Next i
End Sub

--
Kind regards,

Niek Otten

Microsoft MVP - Excel
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top