Search up value and place in right column - VBA

AJ12345

New Member
Joined
Feb 8, 2014
Messages
22
Hi

I have a major problem, so I sincearly hope anyone can help me with this one.

I need to run a <acronym title="visual basic for applications">VBA macr that searches up values based on two parameters</acronym>. See below for illustrative example. There are three input columns (A, B & C). In A I have different project names. The macro should recognize the specific project name for the spreadsheet that is given in cell E1. In column B I have different accounting posts, that should be placed on correct row in the model (each row is named in column E). In column C is the actual value I want to lookup.

The second problem is that the looked up values should return to different columns each time. From column F to AF i have tagged different months. The input in column A,B and C represents one month of data, and should be plased in the correct month. In cell F1 I have a dropdown cell where I can select which month (column) I want to update.

So:
I need help to create a macro that searches up a value based on two inputs (on project and accounting info) and returns the value in a column defined by a dropdown - See exapmle below

Please help me.

ps. If you in adition knows how to do this repetively in several spreadsheets (all look sismilar, but have different project names) I would appreciate help on that one too :smile:

[TABLE="class: cms_table, width: 500"]
<tbody>[TR]
[TD][/TD]
[TD]A[/TD]
[TD]B[/TD]
[TD]C[/TD]
[TD]D[/TD]
[TD]E[/TD]
[TD]F[/TD]
[TD]G[/TD]
[TD]H[/TD]
[TD]I[/TD]
[/TR]
[TR]
[TD]1[/TD]
[TD]Project[/TD]
[TD]Accounting[/TD]
[TD]Value[/TD]
[TD] [/TD]
[TD]1002[/TD]
[TD]Feb 14[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]2[/TD]
[TD]1002[/TD]
[TD]91[/TD]
[TD]345[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]3[/TD]
[TD]1003[/TD]
[TD]91[/TD]
[TD]234[/TD]
[TD][/TD]
[TD][/TD]
[TD]Jan 14[/TD]
[TD]Feb 14[/TD]
[TD]Mar 14[/TD]
[TD]Apr 14[/TD]
[/TR]
[TR]
[TD]4[/TD]
[TD]1001[/TD]
[TD]45[/TD]
[TD]5356[/TD]
[TD][/TD]
[TD]45[/TD]
[TD][/TD]
[TD]677[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]5[/TD]
[TD]1000[/TD]
[TD]67[/TD]
[TD]1432[/TD]
[TD][/TD]
[TD]67[/TD]
[TD][/TD]
[TD]123[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]6[/TD]
[TD]1002[/TD]
[TD]45[/TD]
[TD]677[/TD]
[TD][/TD]
[TD]87[/TD]
[TD][/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]7[/TD]
[TD]1003[/TD]
[TD]45[/TD]
[TD]3431[/TD]
[TD][/TD]
[TD]91[/TD]
[TD][/TD]
[TD]345[/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]8[/TD]
[TD]1002[/TD]
[TD]67[/TD]
[TD]123[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
[TR]
[TD]9[/TD]
[TD]1002[/TD]
[TD]87[/TD]
[TD]1[/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[TD][/TD]
[/TR]
</tbody>[/TABLE]
 

Excel Facts

Format cells as time
Select range and press Ctrl+Shift+2 to format cells as time. (Shift 2 is the @ sign).

Forum statistics

Threads
1,223,911
Messages
6,175,333
Members
452,636
Latest member
laura12345

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top