Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 227
Default out of range error message

You have a space in front of "Information" on the sheet tab.

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6
Default out of range error message

Hi Juergen,

I'm not a fan of downloading files with macros of unknown origin :) so
I can't really test this. But the only reason I can think that you
would get this error on this piece of code is that it can't find the
workbook or the worksheet by those exactly names so I would double
check for typos.

Good Luck!

Reply
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
Error Message - Input Range must be a contiguous Reference Help!!! StuckBim!! Excel Discussion (Misc queries) 0 January 1st 10 10:06 AM
FileCopy Command Giving "Subscript Out of Range" Error Message Jim Hagan Excel Programming 2 June 15th 05 06:07 PM
Subscript Out Of Range Error Message Bob Umlas[_3_] Excel Programming 1 July 28th 04 07:00 PM
Subscript Out Of Range Error Message Tod Excel Programming 0 July 28th 04 06:24 PM
VLookup error message while accessing range in closed workbook. Peter McNaughton Excel Programming 1 September 10th 03 06:11 AM


All times are GMT +1. The time now is 07:13 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"