LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default subscript out of range error for .csv file and vlookup

Assuming the highlights come through as asterisks...

Set Range_Lookup = Workbooks("Inv.csv").worksheets("Sheet1").Range("a 1:g400")
When you open the .csv file, you'll see that that sheet is named after the
filename.

This may work:
Set Range_Lookup = Workbooks("Inv.csv").worksheets("Inv").Range("a1:g 400")

But I'd use:
Set Range_Lookup = Workbooks("Inv.csv").worksheets(1).Range("a1:g400" )

Since there's only one sheet in that .csv workbook.

cultgag wrote:

I'm trying to use vlookup to match some part numbers with data in a .csv
file and so far have been unsuccessful. The highlighted portion keeps
on giving a "Subscript out of Range" and when I scroll over
range_lookup it gives me a message reading "range_lookup = nothing"

lookup_row_value = Sheet3.Cells(row_Numb, 1).Value

*Set Range_Lookup = Workbooks("Inv.csv"). _
Worksheets("Sheet1").Range("a1:g400")*
found_value = Application.VLookup(lookup_row_value, _
Range_Lookup, 5, False)

Sheet3.Cells(row_Numb, 5).Value = found_value

TIA

Matt

--
cultgag
------------------------------------------------------------------------
cultgag's Profile: http://www.excelforum.com/member.php...o&userid=22677
View this thread: http://www.excelforum.com/showthread...hreadid=512718


--

Dave Peterson
 
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:Subscript out of range Jay Excel Discussion (Misc queries) 1 April 10th 08 10:25 PM
Run Time Error 9 (Subscript out of Range) for XLA file ExcelMonkey Excel Discussion (Misc queries) 3 October 5th 05 03:34 PM
Subscript out of range error moglione1 Excel Discussion (Misc queries) 2 August 30th 05 01:21 PM
Type Mismatch error & subscript out of range error Jeff Wright[_2_] Excel Programming 3 May 14th 05 07:14 PM
Subscript out of range error Chris M.[_3_] Excel Programming 1 August 27th 03 05:03 PM


All times are GMT +1. The time now is 06:45 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"