LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27
Default Subscript out of range

Here's my code

Private Sub CommandButton2_Click()
myvar= Application.InputBox("Enter Search Criteria", "Search", "Enter Here")
Workbooks.Open ("c:\Otherbook.xls")
With Workbooks("c:\Otherbook.xls").Worksheets("sheet1") .Range("c2:c10")
Set ref = .Find(myvar)
End With
Response = MsgBox(ref, vbYesNo, "Test")
End Sub

I need my command button to search a range from c2:c10000 on a different
workbook for matching info
and then return the entire row where the match was made. There will be
multiple
matches and each one needs to be returned. This is a test code for myself to
see if the search will return a value and I get

Run-Time error '9':

Subscript out of range.


Please Help
 
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
subscript out of range [email protected] Excel Programming 5 February 19th 07 08:28 PM
9: Subscript out of range jenz21985 Excel Discussion (Misc queries) 6 May 5th 06 03:36 PM
Subscript out of Range Jon[_22_] Excel Programming 4 April 6th 06 11:24 PM
Subscript out of range Bruce001[_6_] Excel Programming 2 December 2nd 05 04:21 PM
Subscript out of range Stacy Haskins[_2_] Excel Programming 4 April 10th 04 05:41 AM


All times are GMT +1. The time now is 07:35 PM.

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

About Us

"It's about Microsoft Excel"