crystal_robinson
New Member
- Joined
- Aug 27, 2013
- Messages
- 2
I think I kind of have a basic feel of what needs to be done, but am not getting it to work. I need to look up a part number and PO number on tab one, and match it to the part and po columns in the table on tab 2, returning the value pieces shipped, from the table from tab 2. I have been using the formula by typing it manually, and no one else in my office is capable of that. Is there a way to make it a macro?
Formula is
=INDEX(Table1,MATCH(C2092&D2092,Table1[Column1]&Table1[Column2],0),7)
I need a macro
{=INDEX("select table array",MATCH("select part"&"select PO","select parts column"&"select PO column",0)"select column number")}
This is my macro, in which I receive an error at the last part for selecting column number and even if I make that a constant I am getting #NAME error
Formula is
=INDEX(Table1,MATCH(C2092&D2092,Table1[Column1]&Table1[Column2],0),7)
I need a macro
{=INDEX("select table array",MATCH("select part"&"select PO","select parts column"&"select PO column",0)"select column number")}
This is my macro, in which I receive an error at the last part for selecting column number and even if I make that a constant I am getting #NAME error
Code:
Sub LookupValuesa()
'
' LookupValues Macro
Set myRange = Application.InputBox( _
prompt:="Select a Range", Type:=8)
Set myPart = Application.InputBox( _
prompt:="Select Part Number To Look Up", Type:=8)
Set myPO = Application.InputBox( _
prompt:="Select PO Number To Look Up", Type:=8)
Set myPartC = Application.InputBox( _
prompt:="Select Parts Column in Data Worksheet", Type:=8)
Set myPOC = Application.InputBox( _
prompt:="Select PO Column in Data Worksheet", Type:=8)
Selection.FormulaArray = _
"=INDEX(myRange,MATCH(myPart&myPO,myPartC&myPOC,0),7)"
End Sub