Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 43
Default Writing Range to Array

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
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Writing Range to Array

Hi
try
Sub Test()
Dim aArray()
Dim rng As Range

Set rng = Range("A1").CurrentRegion
aArray.Value = rng.Value
End Sub

--
Regards
Frank Kabel
Frankfurt, Germany


Marston wrote:
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

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 783
Default Writing Range to Array

Frank Kabel wrote:

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
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,885
Default Writing Range to Array

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

Thanks for the correction


--
Regards
Frank Kabel
Frankfurt, Germany


Alan Beban wrote:
Frank Kabel wrote:

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


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Prb: Writing Array functions in VBA neebington Excel Programming 2 March 3rd 04 04:00 PM
writing array into excel sheet berrie Excel Programming 1 January 23rd 04 11:15 AM
Writing Array Formulas in VBA Ed Excel Programming 4 January 10th 04 08:27 PM
VBA: Writing an array function (like MMult) fxmolden Excel Programming 4 November 13th 03 08:45 PM


All times are GMT +1. The time now is 09:43 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"