View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
juergenkemeter[_17_] juergenkemeter[_17_] is offline
external usenet poster
 
Posts: 1
Default out of range error message


Hi,
When running the following function, there will be an error message
'subscript out of range'. I can't get to the point, why this happens.

If anyone has a suggestion, I would appreciate that.

VBA:

Sub Test()
Dim lStart As Long, lEnd As Long

With
Workbooks("OutOfRange.xls").Worksheets("Informatio n").Columns(2)
On Error Resume Next
lStart = .Find("Database Searches").Row 'first header
lEnd = .Find("Holdings").Row 'second section header
On Error Goto 0
End With
End Sub

I also enclosed the file where this happens.

Cheers
Juergen


+-------------------------------------------------------------------+
|Filename: OutOfRange.zip |
|Download: http://www.excelforum.com/attachment.php?postid=4241 |
+-------------------------------------------------------------------+

--
juergenkemeter
------------------------------------------------------------------------
juergenkemeter's Profile: http://www.excelforum.com/member.php...o&userid=25248
View this thread: http://www.excelforum.com/showthread...hreadid=502785