LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 7
Default Arrays: Subscript out of range

Hello all :-)


For some reason I get stuck on some Subscript out of range error when
running this code.

I wonder if I might have dim(ensioned) as wrong variant or something

Please help me solve this... (btw, the first sheet is about 6000 rows,
and the second is about 1800 rows)

Here is the code:


Sheets("Analyse").Select
Cells(3, 1).Activate
Dim myArray() As Variant
Dim dSett1() As Variant
Dim dSett2() As Variant
Dim dSett3() As Variant

cnt1 = cnt1 + 1

ReDim dSett1(3 To cnt1)
ReDim dSett2(2 To cnt2, 1 To 26)
ReDim myArray(3 To cnt1, 1 To 9)

For i = 3 To cnt1
dSett1(i) = Sheets("Analyse").Cells(i, 1).Value
Next i

For i = 2 To cnt2
For j = 1 To 26
dSett2(i, j) = Sheets("Datasett2").Cells(i, j).Value
Next j
Next i

For i = 3 To cnt1
For k = 2 To cnt2
If dSett1(i) = dSett2(k, 1) Then
For j = 1 To 9
myArray(i, j) = dSett2(i - 1, (9 + j))
Next j
End If
Next k
Next i



Best regards,
-Nortor


 
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
subscript out of range Todd Huttenstine[_3_] Excel Programming 1 June 11th 04 04:08 AM
Subscript out of range? Jason Hancock Excel Programming 3 May 26th 04 07:11 PM
Subscript out of range Ed Excel Programming 1 February 5th 04 07:17 PM
SubScript Out Of Range. Sam Excel Programming 4 December 21st 03 02:10 AM
Subscript Out of Range John Wilson Excel Programming 2 September 7th 03 04:07 AM


All times are GMT +1. The time now is 08:02 AM.

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"