Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hello Everyone,
Can somebody tell me why this gets a Subscript out of range error??? It errors out at the vArray(I) at the bottom. Sub findLastCell_Without_Scrolling() Dim lLastrow As Long, vArray As Variant Dim scrollCol As Integer, scrollRow As Integer Dim I As Integer 'store the scroll settings scrollCol = ActiveWindow.ScrollColumn scrollRow = ActiveWindow.scrollRow 'set a range variable to the first blank lLastrow = Range("A1").End(xlDown).Row 'apply the stored scroll settings ActiveWindow.ScrollColumn = scrollCol ActiveWindow.scrollRow = scrollRow 'display the cell found 'MsgBox firstBlank.Address vArray = Range("A1:A" & lLastrow).Value For I = 1 To lLastrow If vArray(I) = "11/10/2004" Then MsgBox "The Date is " & I: Exit For Next I 'write results out to a column range Range("G5:G" & lLastrow).Value = vArray End Sub |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Error:Subscript out of range | Excel Discussion (Misc queries) | |||
Subscript out of range error | Excel Discussion (Misc queries) | |||
Help on subscript out of range error (VB6/VBA) | Excel Programming | |||
Subscript out of range error | Excel Programming | |||
Subscript out of range error | Excel Programming |