Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
As you can see in the code below, I have created an array that is varying
sizes depending on the data in a worksheet called "Teams". However when I try to assign data into that array. I get a "Subscript out of range" "runtime error-code:9" This happens in the first iteration when i and j are both 1. The data is there in the tworksheet and pots is formed into (1,10) sized dimension based on that data. Any ideas? --- Public Sub GroupDraw() Sheets("Teams").Activate Static count As Integer count = Cells(2, 6) Static groups As Integer groups = Cells(3, 6) Static tpg As Integer tpg = Cells(4, 6) Dim pots() As Variant ReDim pots(1 To tpg, 1 To groups) As Variant For i = 1 To tpg For j = 1 To groups pots(i)(j) = Cells(i * tpg + j, 2) Next Next End Sub --- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"Subscript out of range" error for: Workbooks("Test1.xls").Save | Excel Programming | |||
FileCopy Command Giving "Subscript Out of Range" Error Message | Excel Programming | |||
"Subscript out of range Runtime Error 9" | Excel Programming | |||
SaveAs "subscript out of range" error (COM - SOAP) | Excel Programming | |||
SaveAs "subscript out of range" error (COM - SOAP) | Excel Programming |