Hello together,
i am new here and i hope that someone with deeper Excel VBA knowledge can help me out with my problem.
I got an Listobject (see my example below) where i have some data. To be specific it has the columns year, week and value.
I need to write a function in VBA which has the input parameters year and week and the output parameter value.
It should search my Listobject like this:
1) search column YEAR for the given year (there are multiple entires up to 53, 1 Year can have 52 to 54 Weeks)
2) search in the columns that have this year listed for the week.
3) put the specific data from the column VALUE that belongs to the searched year and week. There can only be 1 match for this.
How can i realise that?
Example:
Function input: 2018, 4
Funktion output: D
[TABLE="width: 200"]
<tbody>[TR]
[TD]YEAR[/TD]
[TD]WEEK[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]1[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[TD]2[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[TD]3[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[TD]4[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]1[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]2[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]3[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]4[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]5[/TD]
[TD]I[/TD]
[/TR]
</tbody>[/TABLE]
Thank you very much!
i am new here and i hope that someone with deeper Excel VBA knowledge can help me out with my problem.
I got an Listobject (see my example below) where i have some data. To be specific it has the columns year, week and value.
I need to write a function in VBA which has the input parameters year and week and the output parameter value.
It should search my Listobject like this:
1) search column YEAR for the given year (there are multiple entires up to 53, 1 Year can have 52 to 54 Weeks)
2) search in the columns that have this year listed for the week.
3) put the specific data from the column VALUE that belongs to the searched year and week. There can only be 1 match for this.
How can i realise that?
Example:
Function input: 2018, 4
Funktion output: D
[TABLE="width: 200"]
<tbody>[TR]
[TD]YEAR[/TD]
[TD]WEEK[/TD]
[TD]VALUE[/TD]
[/TR]
[TR]
[TD]2018
[/TD]
[TD]1[/TD]
[TD]A[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[TD]2[/TD]
[TD]B[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[TD]3[/TD]
[TD]C[/TD]
[/TR]
[TR]
[TD]2018[/TD]
[TD]4[/TD]
[TD]D[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]1[/TD]
[TD]E[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]2[/TD]
[TD]F[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]3[/TD]
[TD]G[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]4[/TD]
[TD]H[/TD]
[/TR]
[TR]
[TD]2019[/TD]
[TD]5[/TD]
[TD]I[/TD]
[/TR]
</tbody>[/TABLE]
Thank you very much!