Fill array with Values

  • Thread starter Thread starter Brad
  • Start date Start date
B

Brad

Thanks for taking the time to read my question.

This does not work, and I'm not sure how else to write the code so that each
array will be filled with the values.

Any help would be great,

Thanks,

Brad


code=========================
Dim lowlet() As String
Dim upperlet() As String
Dim thenum() As Integer
Dim chara() As String

lowlet() = "a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z"
upperlet() = "A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z"
thenum() = "1,2,3,4,5,6,7,8,9,0"
chara() = "!@#%^*"
 
Hi
At top of module put
Option Base 1

Inside a sub you can do
lowlet = Array("a", "b",... etc)

then lowlet(2) will be "b" as array counting starts at 1.
regards
Paul
Note you could probably do these examples more efficiently using ascii
codes and looping to fill the arrays.
 
Sorry, forgot to mention you will have to declare
Dim lowlet as Variant

regards
Paul
 
Try these...

lowlet() = Split("a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z", ",")
upperlet() = Split("A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z",
",")
thenum() = Split("1,2,3,4,5,6,7,8,9,0", ",")
chara() = Split("!,@,#,%,^,*", ",")

I'm curious as to why you are setting up these particular arrays and how you
plan to use them... depending on what it is you are going to do with these
arrays, it is possible that there might be other (more efficient) ways to do
it without using these arrays.
 
Thanks to both of you for your great replies. They were very helpful

Have a great day,

Brad
 
Back
Top