Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Is there a macro for returning multiple values through a Vlookup?

Foe eg: Sheet2 contains:

Project# Phase Sp# Details status Manager ...
1234 1-0110 N80 abc Test am
1234 1-0210 N97 def Incom bd
1234 2-0210 N45 lmn Test cf
1234 1-0110 N67 jkl Com er


Sheet1 contains:

Project# Phase SP# Status Manager
1234 1-0110

The above 2 values are inserted by the user:
Now: On running the macro:

the sheet 1 should be populated with all the records for phase 1-0110
Desired output:

Project# Phase Sp# Status Manager
1234 1-0110 N80 Test am
N65 Com er

Any help would be greatly appreciated!!!
Thanks
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Is there a macro for returning multiple values through a Vlookup?

How about a PivotTable or Advanced Filter instead?

--JP

On Jan 19, 2:49*pm, anshu minocha wrote:
Foe eg: Sheet2 contains:

Project# * Phase * Sp# * Details status Manager ...
1234 * * * *1-0110 *N80 * abc * * * Test * *am
1234 * * * *1-0210 *N97 * def * * * *Incom *bd
1234 * * * *2-0210 *N45 * lmn * * * Test * *cf
1234 * * * *1-0110 *N67 * jkl * * * * Com * *er

Sheet1 contains:

Project# *Phase * SP# * Status *Manager
1234 * * * 1-0110

The above 2 values are inserted by the user:
Now: On running the macro:

the sheet 1 should be populated with all the records for phase 1-0110
Desired output:

Project# Phase *Sp# *Status Manager
1234 * * *1-0110 *N80 *Test * *am
* * * * * * * * * * * * *N65 *Com * *er

Any help would be greatly appreciated!!!
Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Is there a macro for returning multiple values through a Vlookup?

Hey JP,

But the requirement is to obtain the values on a single
click.So was thing of writing a macro:
If atleast the macro can Populate all the SP# for the particular phase

Sheet1:

Project# Phase SP#
1234 1-0110 N80
N65
Is it possible to get all the SPId's getting populated for phase
1-0110 from sheet2 using a macro
Please advise
Thanks
  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,124
Default Is there a macro for returning multiple values through a Vlookup?

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"anshu minocha" wrote in message
...
Hey JP,

But the requirement is to obtain the values on a single
click.So was thing of writing a macro:
If atleast the macro can Populate all the SP# for the particular phase

Sheet1:

Project# Phase SP#
1234 1-0110 N80
N65
Is it possible to get all the SPId's getting populated for phase
1-0110 from sheet2 using a macro
Please advise
Thanks


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 897
Default Is there a macro for returning multiple values through a Vlookup?

You can create PivotTables and Advanced Filters using VBA. If only you
would do a search to find out how to use those tools.

You could also put the data into Access and create a parameter query
that asks you for the Project# and Phase, and returns a table with the
matching records.

--JP

On Jan 20, 1:49*pm, anshu minocha wrote:
Hey JP,

* * * * * *But the requirement is to obtain the values on a single
click.So was thing of writing a macro:
If atleast the macro can Populate all the SP# for the particular phase

Sheet1:

Project# * *Phase * * SP#
1234 * * * * 1-0110 * * N80
* * * * * * * * * * * * * * * N65
Is it possible to get all the SPId's getting populated for phase
1-0110 from sheet2 using a macro
Please advise
Thanks




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 698
Default Is there a macro for returning multiple values through a Vlookup?

Hi Anshu,

Give this a test, you will have to change the ranges in the code to suit
your sheet or set up an example on your sheet to match the code ranges.
Can be tweeked to suit of course.

Sub TheProjects()
Dim i As Long
Dim j As Variant
Dim Pro As Range
Dim Pha As Range
Dim cell As Range

i = Range("I9").Value ' Type Project number in I9
j = Range("J9").Value ' Type Phase number in J9
Set Pro = Range("B9:B12") ' List of Project# range
Set Pha = Range("C9:C12") ' List of Phase numbers range

'Copies the Pro and Pha number into the next available row in Column I and J
Range("I9:J9").Copy Range("K100").End(xlUp).Offset(1, -2).Resize(1, 2)

'Gathers the info for Pro range and Pha range and copies to the
'next available row in column K
For Each cell In Pro
If cell.Value = i And cell.Offset(0, 1).Value = j Then
cell.Offset(0, 2).Resize(1, 4).Copy
Range("K100").End(xlUp).Offset(1, 0)
End If
Next
End Sub

HTH
Regards,
Howard

"anshu minocha" wrote in message
...
Foe eg: Sheet2 contains:

Project# Phase Sp# Details status Manager ...
1234 1-0110 N80 abc Test am
1234 1-0210 N97 def Incom bd
1234 2-0210 N45 lmn Test cf
1234 1-0110 N67 jkl Com er


Sheet1 contains:

Project# Phase SP# Status Manager
1234 1-0110

The above 2 values are inserted by the user:
Now: On running the macro:

the sheet 1 should be populated with all the records for phase 1-0110
Desired output:

Project# Phase Sp# Status Manager
1234 1-0110 N80 Test am
N65 Com er

Any help would be greatly appreciated!!!
Thanks



  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Is there a macro for returning multiple values through a Vlookup?

You did not follow my instructions
If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.


--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"anshu minocha" wrote in message
...
Hey JP,

But the requirement is to obtain the values on a single
click.So was thing of writing a macro:
If atleast the macro can Populate all the SP# for the particular phase

Sheet1:

Project# Phase SP#
1234 1-0110 N80
N65
Is it possible to get all the SPId's getting populated for phase
1-0110 from sheet2 using a macro
Please advise
Thanks


  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Is there a macro for returning multiple values through a Vlookup?

Hello Don,
I did send it on your gmail id.
Thanks
  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,522
Default Is there a macro for returning multiple values through a Vlookup?


I did NOT get it and if you can't do it in the manner I request, I will not
be able to assist. Follow these instructions.

If desired, send your file to my address below. I will only look if:
1. You send a copy of this message on an inserted sheet
2. You give me the newsgroup and the subject line
3. You send a clear explanation of what you want
4. You send before/after examples and expected results.
--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"anshu minocha" wrote in message
...
Hello Don,
I did send it on your gmail id.
Thanks


  #10   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Is there a macro for returning multiple values through a Vlookup?

Thankyou I happened to figure out the problem.
Thanks JP and Don


  #11   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 23
Default Is there a macro for returning multiple values through a Vlookup?

Thankyou Howard
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
Returning Multiple values from A Vlookup mickn74 Excel Worksheet Functions 3 February 27th 10 04:13 AM
returning multiple cell values from a vlookup SueB Excel Worksheet Functions 7 August 30th 08 12:28 AM
Vlookup - returning multiple vertical values seed Excel Discussion (Misc queries) 4 August 14th 08 01:47 PM
Using VLOOKUP for returning multiple values and summing them LCC Jon-Kun[_2_] Excel Worksheet Functions 2 June 5th 08 03:37 PM
vlookup returning multiple values soph Excel Worksheet Functions 2 October 14th 05 05:17 AM


All times are GMT +1. The time now is 09:33 PM.

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

About Us

"It's about Microsoft Excel"