VBA MATCH WITH COPY AND PASTE

excellmate

New Member
Joined
Jan 28, 2006
Messages
15
Hi,

I have the following problem:

Given Data :

Columns B and C contain related data :
Column B contain cells with either a six digit number or the text "PRCH";
Column C contains cells with a monetary amount;

Columns F and G contain related data :
Column F contains cells with a six digit number
Column G contains cells with a monetary amount;

95% of the numbers in columns B and F have been successfully matched, leaving ALL the "PRCH" cells unmatched and a small number of six digit numbers unmatched.

Problem : I need to find a six digit number from the cells in column F to replace the "PRCH" text in the cells in column B.

How I see this problem being tackled :
a)LOOKUP cells in column B to search for cells containing the text" PRCH" (say B 1234 ) ;
b) MATCH the monetary-value related data in cell C1234 (say, $891) with the monetary amounts in column G:
b) IF there is a match of the monetary value in Column G in ,say G6822, THEN Column B is LOOKED-UP to find the same number that is in cell F6822.
c)IF the number in cell F6822 is matched with a similar number in column B, then we know that the number has been previously matched ( so WE HAVE GOT THE WRONG $891). We therefore have to continue the MATCH;
d) Continue the MATCH of $891 from column G until there is a NO MATCH in Column B; We now know that the data in columns F and G have not been previously matched, so we have got the correct $891.
e) If we have the right data in, say, cells F9546 and G9546, THEN we need to COPY the number in F9546 and PASTE it in cell B1234, thus over-writing the "PRCH" text in cell B1234.

Can anyone help with this problem?
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college

Forum statistics

Threads
1,215,042
Messages
6,122,810
Members
449,095
Latest member
m_smith_solihull

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