Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 127
Default Vlookup - Multiple Sheet HELP PLEASEEEEEEEEE

Please I need help in vlook up using macro. I have multiple sheets in a Wk
book and would like to lookup E5 from data range in another workbook and
return column 2 data.

I want the result to be displayed in A10 across multiple sheets based on
their corresponding E5 cell lookup value.

Wk Book 1
Sheet 1 Cell E5
J45Offe_1

Sheet 2 Cell E5
Pl09Kiy_6

Wkbook 2
Cell A1 J45Offe_1 CEll B1 JungleBoy
Cell A2 Pl09Kiy_6 Cell B2 HuntingWizz

Final Output
For Sheet 1
Cell A10 = JungleBoy

For Sheet 2
Cell A10 = HuntingWizz

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,836
Default Vlookup - Multiple Sheet HELP PLEASEEEEEEEEE

Check this out:
http://www.ozgrid.com/VBA/VlookupAllSheets.htm

The Custom Excel Functions

Function VLOOKAllSheets(Look_Value As Variant, Tble_Array As Range, _
Col_num as Integer, Optional Range_look as Boolean)

''''''''''''''''''''''''''''''''''''''''''''''''
'Written by OzGrid.com

'Use VLOOKUP to Look across ALL Worksheets and stops _
at the first match found.
'''''''''''''''''''''''''''''''''''''''''''''''''
Dim wSheet As Worksheet
Dim vFound

On Error Resume Next

For Each wSheet In ActiveWorkbook.Worksheets
With wSheet
Set Tble_Array = .Range(Tble_Array.Address)
vFound = WorksheetFunction.VLookup _
(Look_Value, Tble_Array, _
Col_num, Range_look)
End With
If Not IsEmpty(vFound) Then Exit For
Next wSheet

Set Tble_Array = Nothing
VLOOKAllSheets = vFound
End Function

To use this code do this:

1. Push Alt+F11 and go to InsertModule
2. Copy and paste in the code.
3. Push Alt+Q and Save.

Now in any cell put in the Function like this:

=VLOOKAllSheets("Dog",C1:E20,2,FALSE)

Where "Dog" is the value to find

" " C1:E20 is the range to look in the first column and find "Dog"

" " 2 is the relative column position in C1:E20 to return return our result
from.

" " FALSE (or ommited) means find and exact match of "Dog"

In other words the UDF has the exact same syntax as Excels VLOOKUP. The only
difference is that it will look in ALL Worksheets and stop at the first
match.


Regards,
Ryan---

--
RyGuy


"Yossy" wrote:

Please I need help in vlook up using macro. I have multiple sheets in a Wk
book and would like to lookup E5 from data range in another workbook and
return column 2 data.

I want the result to be displayed in A10 across multiple sheets based on
their corresponding E5 cell lookup value.

Wk Book 1
Sheet 1 Cell E5
J45Offe_1

Sheet 2 Cell E5
Pl09Kiy_6

Wkbook 2
Cell A1 J45Offe_1 CEll B1 JungleBoy
Cell A2 Pl09Kiy_6 Cell B2 HuntingWizz

Final Output
For Sheet 1
Cell A10 = JungleBoy

For Sheet 2
Cell A10 = HuntingWizz

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,560
Default Vlookup - Multiple Sheet HELP PLEASEEEEEEEEE

Hi,

Your information is a little sparse, but
Sub Macro1()
'Run from Book1, cell A10, looking up value in Book1 cell E10
ActiveCell.FormulaR1C1 = "=VLOOKUP(RC[4],[Book2]Sheet1! _
R1C5:R1C6,2,FALSE)"
End Sub

Maybe this will help?
David
"Yossy" wrote:

Please I need help in vlook up using macro. I have multiple sheets in a Wk
book and would like to lookup E5 from data range in another workbook and
return column 2 data.

I want the result to be displayed in A10 across multiple sheets based on
their corresponding E5 cell lookup value.

Wk Book 1
Sheet 1 Cell E5
J45Offe_1

Sheet 2 Cell E5
Pl09Kiy_6

Wkbook 2
Cell A1 J45Offe_1 CEll B1 JungleBoy
Cell A2 Pl09Kiy_6 Cell B2 HuntingWizz

Final Output
For Sheet 1
Cell A10 = JungleBoy

For Sheet 2
Cell A10 = HuntingWizz

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
VLOOKUP - columnar sheet with multiple matches - need to return a dawgfan Excel Worksheet Functions 7 October 9th 09 02:09 AM
How to VLOOKUP multiple sheets and each sheet have 65536 rows? nginhong Excel Worksheet Functions 9 June 4th 09 02:05 AM
Using Vlookup with multiple sheet Jammings Excel Worksheet Functions 3 December 31st 08 04:02 AM
vlookup in a multiple sheet file MICMERG Excel Worksheet Functions 5 June 2nd 08 05:23 PM
connecting multiple cells to new sheet (VLOOKUP?IF?) Gregula Excel Worksheet Functions 1 August 18th 06 08:03 PM


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