Match data then copy

excelmacro

Board Regular
Joined
Apr 8, 2002
Messages
50
I want to create a macro that first searches through an excel file containing raw data ("monthly"), and then automatically load certain parts of the data into another excel file ("information").

The raw data file ("monthly") has three columns that I am concerned with, column A (cost center) , D (prime) , and F (cost).

The file information has only one cost center in it (whereas monthly has many), but many primes (usually more than monthly). The reason for this is that primes in raw data (monthly) aren't present for certain cost centers if there is no cost for the prime (a little confusing but no cost= no prime for that cost center).

The primes in information are in column A, and the costs are in monthly columns.

The raw data (monthly) varies in length from month to month due to there being no cost for that prime in that month.

So i guess what i am looking for is a macro that will ask the user for the cost center they are looking for, then which coumn they want the information to be inserted into (ie which month the data is for), and then use the user inputted cost center to find the corresponding cost center in raw data column A, match the primes in raw data column D and information column A (for that cost center), and then copy the raw data column F (cost) for the for that prime into the information column that the user specifies.

I realize this is a lot to help with, but if you can help with one part, I would appreciate it.
 

Excel Facts

How to find 2nd largest value in a column?
MAX finds the largest value. =LARGE(A:A,2) will find the second largest. =SMALL(A:A,3) will find the third smallest

Forum statistics

Threads
1,214,641
Messages
6,120,695
Members
448,979
Latest member
DET4492

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