# VBA MATCH WITH COPY AND PASTE

#### excellmate

##### New Member
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

When they said...
When they said you are going to "Excel at life", they meant you "will be doing Excel your whole life".

Replies
18
Views
492
Replies
5
Views
171
Replies
5
Views
157
Replies
5
Views
224
Replies
9
Views
614

1,220,987
Messages
6,157,239
Members
451,407
Latest member
vdaesety

### 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.

### Which adblocker are you using?

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

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