D
daniroy
Hello everybody, and first of all, thank you for the help I receive
here.
I have to come back on the question I did raise yesterday.
A few days ago, I did receive very good help from Max and Dave to
achieve the following formula that I do array-enter:
{=INDEX(AUTOS!$K$10:$K$500,MATCH(1,(Autos!$F$10:$F$500='ID'!D5)
*(Autos!$G$10:$G$400='ID'!$R$2),0))}
This formula is working just fine. I enter it in sheet("ID"), lets
say cells(I6).
I now want and need not to use Formulas anymore, but to code them in
VB.
______________________________________
Sub GetPrice()
Dim Price1 as Single
Price1 = unknow code
Cell("I6").Value = Price 1
______________________________________
To make myself clearer, my spreadsheet("Autos") is built has follow
Column F Column G Column K
Dates Reference Price
16/09/2005 52 48
16/09/2005 53 46
16/09/2005 54 44
16/09/2005 55 38
16/09/2005 56 36
21/10/2005 52 72
21/10/2005 53 64
21/10/2005 54 59
15/11/2005 55 55
15/11/2005 56 51
And basically I need to retrieve a Price meeting both Dates and
Reference criteria. And to setup this price as a Variable I store in VB
and display in my Sheet.
Any help will be appreciated, as I do not have the VB knowledge yet to
create it on my own. Thanks in advance.
Best regards
Daniel ROY
here.
I have to come back on the question I did raise yesterday.
A few days ago, I did receive very good help from Max and Dave to
achieve the following formula that I do array-enter:
{=INDEX(AUTOS!$K$10:$K$500,MATCH(1,(Autos!$F$10:$F$500='ID'!D5)
*(Autos!$G$10:$G$400='ID'!$R$2),0))}
This formula is working just fine. I enter it in sheet("ID"), lets
say cells(I6).
I now want and need not to use Formulas anymore, but to code them in
VB.
______________________________________
Sub GetPrice()
Dim Price1 as Single
Price1 = unknow code
Cell("I6").Value = Price 1
______________________________________
To make myself clearer, my spreadsheet("Autos") is built has follow
Column F Column G Column K
Dates Reference Price
16/09/2005 52 48
16/09/2005 53 46
16/09/2005 54 44
16/09/2005 55 38
16/09/2005 56 36
21/10/2005 52 72
21/10/2005 53 64
21/10/2005 54 59
15/11/2005 55 55
15/11/2005 56 51
And basically I need to retrieve a Price meeting both Dates and
Reference criteria. And to setup this price as a Variable I store in VB
and display in my Sheet.
Any help will be appreciated, as I do not have the VB knowledge yet to
create it on my own. Thanks in advance.
Best regards
Daniel ROY