Dynamic Array

M

Michael168

I try to declare a dynamic array but don't know how. This is what I wan
to do in plain english. I use columns A1:AP1 to let the user key i
each individual number. From the range that have numbers, I use th
counter as array size.

e.g

Sub Lwheel()

Dim wheel()
Q1. Redim Wheel(0 to ?(how to get this value equal to the range A1:AP
that been used?))

Example the user key in A1=1,A2=2,A3=3,A4=11,A5=21,A6=32,A7=38

So that the array becomes as below;
Wheel(0)=A1 # 1
Wheel(1)=A2 # 2
Wheel(2)=A3 # 3
Wheel(3)=A4 # 11
Wheel(4)=A5 # 21
Wheel(5)=A6 # 32
Wheel(6)=A7 # 38

Some codes

End Sub

Regards
Michae
 
B

Bob Phillips

Try the worksheet COUNTA fun ction

worksheetfunction.counta(Range("A1:AP1"))

--

HTH

Bob Phillips
... looking out across Poole Harbour to the Purbecks
(remove nothere from the email address if mailing direct)
 

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