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

Why can't I fill my array from the range below? I have ensured that the
range is (8 rows X 3 columns).

Dim lngLastRow As Long
Dim aryUserInfo(8, 3) As String

' set array equal to username range
With Workbooks("QG Add-In.xla").Sheets("Login Data")
lngLastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Error aryUserInfo = .Range("B2:D" & lngLastRow).Value
End With
--
Cheers,
Ryan
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,494
Default Fill Array from a Range

this works for me. just set a breakpoint on the end sub
then view/locals window

you can then expand the array clicking on the +


Sub test()
Dim lngLastRow As Long
Dim aryUserInfo As Variant

' set array equal to username range
With Worksheets("Login Data")
lngLastRow = .Cells(Rows.Count, "A").End(xlUp).Row
aryUserInfo = .Range("B2:D" & lngLastRow).Value
End With

--


Gary

"RyanH" wrote in message
...
Why can't I fill my array from the range below? I have ensured that the
range is (8 rows X 3 columns).

Dim lngLastRow As Long
Dim aryUserInfo(8, 3) As String

' set array equal to username range
With Workbooks("QG Add-In.xla").Sheets("Login Data")
lngLastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Error aryUserInfo = .Range("B2:D" & lngLastRow).Value
End With
--
Cheers,
Ryan



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,549
Default Fill Array from a Range

Excel 97 does not allow array assignment. In later versions, it is allowed.
--
Jim Cone
Portland, Oregon USA



"RyanH"
wrote in message
Why can't I fill my array from the range below? I have ensured that the
range is (8 rows X 3 columns).

Dim lngLastRow As Long
Dim aryUserInfo(8, 3) As String

' set array equal to username range
With Workbooks("QG Add-In.xla").Sheets("Login Data")
lngLastRow = .Cells(Rows.Count, "A").End(xlUp).Row
Error aryUserInfo = .Range("B2:D" & lngLastRow).Value
End With
--
Cheers,
Ryan
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
Redimming an array dynamically assigned from range (how to redim first dimension of a 2-D array? /or/ reverse the original array order) Keith R[_2_] Excel Programming 3 November 13th 07 04:08 PM
Create an Array to fill a Range jollynicechap Excel Programming 3 December 29th 06 07:15 PM
how do i fill an array? tia JasonK[_2_] Excel Programming 7 September 19th 06 07:31 PM
fill array [email protected][_2_] Excel Programming 7 March 20th 06 01:01 PM
fill down array to last available row [email protected] Excel Worksheet Functions 10 May 19th 05 10:52 PM


All times are GMT +1. The time now is 04:12 PM.

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

About Us

"It's about Microsoft Excel"