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?
 

Some videos you may like

Excel Facts

How to change case of text in Excel?
Use =UPPER() for upper case, =LOWER() for lower case, and =PROPER() for proper case. PROPER won't capitalize second c in Mccartney

Watch MrExcel Video

Forum statistics

Threads
1,113,850
Messages
5,544,656
Members
410,627
Latest member
georgealice
Top