Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
I'm sure this is blindingly obviously but I have a UBound function returning 0 when I can see (in the locals window) that the array has been filled, so I never get past the first loop of "For x.....". Here's the code: Private Sub PopulateSheet(ByRef vFilesArray As Variant) Dim iCol As Integer Dim iStartRow As Integer Dim wks As Worksheet Set wks = Application.Worksheets(1) iCol = 2 iStartRow = 5 'Starting row For x = 0 To UBound(vFilesArray, 1) wks.Cells(iStartRow + x, iCol).Value = vFilesArray(x) Next x End Sub Can anyone tell me what I'm doing wrong please? FYI - Locals window gives the following values: - : vFilesArray(0) : : Variant/String(0 to 3) : vFilesArray(0)(0) : "018.jpg" : String : vFilesArray(0)(1) : "056.jpg" : String : vFilesArray(0)(2) : "089.jpg" : String : vFilesArray(0)(3) : "135.jpg" : String Best regards John |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Subscript out range error when redimensioning dynamic array | Excel Programming | |||
array: subscript out of range | Excel Programming | |||
Subscript out of range problem | Excel Programming | |||
Redim 2D Array Subscript Out Of Range Error | Excel Programming | |||
Subscript Out of Range error in Array... | Excel Programming |