Writing a macro to search for data in one sheet & match it to another

yall003

New Member
Joined
Jul 1, 2011
Messages
2
<TABLE style="MARGIN: auto auto auto 5.4pt; WIDTH: 451.3pt; BORDER-COLLAPSE: collapse" border=0 cellSpacing=0 cellPadding=0 width=602><TBODY><TR style="HEIGHT: 16.5pt"><TD style="BORDER-BOTTOM-COLOR: #f0f0f0; PADDING-BOTTOM: 0cm; BACKGROUND-COLOR: transparent; BORDER-TOP-COLOR: #f0f0f0; PADDING-LEFT: 5.4pt; WIDTH: 451.3pt; PADDING-RIGHT: 5.4pt; HEIGHT: 16.5pt; BORDER-RIGHT-COLOR: #f0f0f0; BORDER-LEFT-COLOR: #f0f0f0; PADDING-TOP: 0cm" vAlign=bottom width=602 noWrap>Hi there,
I need help writing a macro to match 2 sheets of data. Basically I have 2 sheets of different data with one column containing common figures.
</TD></TR><TR style="HEIGHT: 16.5pt"><TD style="BORDER-BOTTOM-COLOR: #f0f0f0; PADDING-BOTTOM: 0cm; BACKGROUND-COLOR: transparent; BORDER-TOP-COLOR: #f0f0f0; PADDING-LEFT: 5.4pt; WIDTH: 451.3pt; PADDING-RIGHT: 5.4pt; HEIGHT: 16.5pt; BORDER-RIGHT-COLOR: #f0f0f0; BORDER-LEFT-COLOR: #f0f0f0; PADDING-TOP: 0cm" vAlign=bottom width=602 noWrap>Sheet 2 has a number of columns with different headings. The heading in 'column a' of sheet 2 is 'ID no.' I want my macro to search for each of these figures in sheet 1's 'column v' (which is also titled 'ID no'). When it finds a match, I want it to move the row of data (except the 'column a' figure) next to its corresponding 'ID no' figure in sheet 1, starting in 'column AK.'

Not all of the data will have a match. A next step would be to have a messagebox saying, “x amount of matches out of x total,” but the core problem is much more important.

I would be very grateful for any help.

Thanks,

Jacob
</TD></TR></TBODY></TABLE>
 

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
You don't need a macro to do that.
Have a look at index/match which will give you the same results for the first bit without the need for a macro.
 
Upvote 0

Forum statistics

Threads
1,224,522
Messages
6,179,297
Members
452,903
Latest member
Knuddeluff

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