Macro for Lookup

macdca

Board Regular
Joined
Sep 28, 2010
Messages
170
Can anyone tell me how to write a macro for a VLOOK up procedure, lining to a worksheet which looks up over 2 worksheets?

Thanks
 
In the sheets that you are trying to lookup from, which column contains the text Post Code and which column contains the value that you wish to return?
 
Upvote 0

Excel Facts

Which lookup functions find a value equal or greater than the lookup value?
MATCH uses -1 to find larger value (lookup table must be sorted ZA). XLOOKUP uses 1 to find values greater and does not need to be sorted.
Try

=VLOOKAllSheets("Post Code",A2:C6500,3,FALSE)

If you are trying to look up an actual postcode, not the text Post Code you need to change the formula accordingly.
 
Upvote 0
Yes I am looking up actual post codes against a look up of actual post codes and want to return the wider area, from column C of the look up - what change do I need to make to the formula??
 
Upvote 0
Also, when i place the curser in the formula the selection is from, the data sheet I am trying to populate rather than the look up worksheets, is this right?
 
Upvote 0
They are in column E of my main datasheet. they should look up column A of the look up (worksheets named 1 2 and 3) and display the wider area from column C of the look up?
 
Upvote 0
sorry I should have said. the wider areas are to be displayed in a new column in my datasheet (column H) where I have pasted the look up formula
 
Upvote 0
GETTING THERE I THINK, THE FIELDS NOW DISPLAY <TABLE style="WIDTH: 62pt; BORDER-COLLAPSE: collapse" cellSpacing=0 cellPadding=0 width=82 border=0 x:str><COLGROUP><COL style="WIDTH: 62pt; mso-width-source: userset; mso-width-alt: 2998" width=82><TBODY><TR style="HEIGHT: 12.75pt" height=17><TD class=xl22 style="BORDER-RIGHT: #e0dfe3; BORDER-TOP: #e0dfe3; BORDER-LEFT: #e0dfe3; WIDTH: 62pt; BORDER-BOTTOM: #e0dfe3; HEIGHT: 12.75pt; BACKGROUND-COLOR: transparent" align=middle width=82 height=17 x:err="#NAME?">#NAME?

</TD></TR></TBODY></TABLE>
 
Upvote 0

Forum statistics

Threads
1,224,609
Messages
6,179,879
Members
452,948
Latest member
Dupuhini

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top