View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Bernie Deitrick Bernie Deitrick is offline
external usenet poster
 
Posts: 5,441
Default Increment Alpha Character

Dan,

You can create a string that you can use in your code, as below:

HTH,
Bernie
MS Excel MVP

Sub TryNow()
Dim i As Integer
Dim j As Integer
Dim k As Integer
Dim l As Integer
Dim myName As String

For i = 1 To 26
For j = 1 To 26
For k = 1 To 26
For l = 1 To 26
myName = Chr(i + 64) & _
Chr(j + 64) & _
Chr(k + 64) & _
Chr(l + 64)
'Then use myName in your code
MsgBox myName
Next l
Next k
Next j
Next i
End Sub


"Dan" wrote in message
...
All,

I have a macro which sends data out to a .csv file. My
problem is that I need each line
of the .csv file to have a unique four digit alpha
character starting with AAAA and working all the way to
ZZZZ. I have no clue how to do this.