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: 5
Default Searching values in VBA

Pierre,

Here's an answer i posted recently. It seems to fit you
question as well.

I like using Named Ranges. I try to design my Tables in
Excel using the following rules

List/table is isolated from other data
List/table is contiguous (no empty columns/rows)
List/Table has ONE ROW of unique headings

Under these conditions I use the CurrentRegion Icon to
SELECT the entire list/table and then Insert/Name/Create-
Create names in TOP row.

I then use column range names in all my worksheet
formulas and in my VBA code.

Sub LoadMasterTable
Dim r as range, sItem as string, ptr as variant
Dim wsMaster as worksheet, wsPrice as worksheet
Set wsMaster = Sheets("Master Table")
Set wsPrice = Sheets("Price Table")
With wsMaster
For Each r in .Range(.Cells(2, 1), .Cells(2, 1).End
(xlDown))
With r
sItem = .Value
ptr = application.match(sItem, wsPrice .Range
("Price_Table_Item"),0)
If Not IsError(ptr) Then
.Offset(0, 1).Value = application.index(range
("Price_Table_Price"),ptr, 1)
End If
End with
Next
End With
End Sub



-----Original Message-----
Hi

I use a lot of INDEX/MATCH in my workbooks and I am

looking for an
equivalent to INDEX/MATH or VLOOKUP in VBA.

When I have large sets of data I create Variant Arrays

and I would
need a way to VLOOKUP things in one array to bring

values in the other
array.

Anyone?
Pierre Leclerc
http://www.excel-vba.com

.

 
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
Searching for values Paul Peterson - Velox Consulting, LLC Excel Discussion (Misc queries) 1 December 8th 09 04:50 PM
Searching for values Paul Peterson - Velox Consulting, LLC Excel Discussion (Misc queries) 0 December 8th 09 04:26 PM
Searching for a cell with specified values FredL Excel Discussion (Misc queries) 6 March 16th 07 04:49 PM
Searching for cell values alistre Excel Discussion (Misc queries) 2 August 24th 06 03:45 AM
searching for values and summing the corresponding values Simon Excel Worksheet Functions 1 February 4th 05 12:13 AM


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

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"