Writing Range to Array

  • Thread starter Thread starter Marston
  • Start date Start date
M

Marston

Can someone tell me what I'm not doing correctly?

Sub Test()
Dim aArray as Variant
Dim rng As Range
Range("A1").Select
Set rng = ActiveCell.CurrentRegion.Select
aArray.Value = rng.Value
End Sub
 
Hi
try
Sub Test()
Dim aArray()
Dim rng As Range

Set rng = Range("A1").CurrentRegion
aArray.Value = rng.Value
End Sub
 
Frank said:
Hi
try
Sub Test()
Dim aArray()
Dim rng As Range

Set rng = Range("A1").CurrentRegion
aArray.Value = rng.Value
End Sub
That doesn't work either, at least not in xl2000. So either it wasn't
tested before posting or Frank Kabel is using a later version in which
it works. Use

aArray = rng.Value

or

Dim aArray As Variant
aArray = rng or aArray = rng.Value

Alan Beban
 
Hi Alan
just a typo on my site. Forgot to remove the .value part

Thanks for the correction
 

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

Back
Top