Constants as arrays?
Oh, yeah...
This is the way to do it - thanks, Peter :-)
Peter T wrote:
Const cDOCS As String = "Rules.doc\Personal.doc\Reporting.doc"
Sub test()
Dim v
For Each v In Split(cDOCS, "\")
MsgBox v, , "For Each"
Next
' or
Dim i As Long, arr
arr = Split(cDOCS, "\")
For i = 0 To UBound(arr)
MsgBox arr(i), , "For i ="
Next
End Sub
Regards,
Peter T
"Charlotte E" <@ wrote in message
...
Hello,
Is there a way to make Constants as Arrays?
Something like:
Public Const Doc(1) As String = "Rules.DOC"
Public Const Doc(2) As String = "Personal.DOC"
Public Const Doc(3) As String = "Reporting.DOC"
etc...
Currently I'm using:
Public Const Doc_01 As String = "Rules.DOC"
Public Const Doc_02 As String = "Personal.DOC"
Public Const Doc_03 As String = "Reporting.DOC"
...but that doesn't allow me to run through the documents in a loop,
like a For-To-Next.
Any suggentions?
TIA,
|