Filtering rates from rows

Drewgarry007

Board Regular
Joined
Oct 1, 2011
Messages
142
Hi there,
I have a list of exchange rates in column D in sheet1 and have a second list of exchange rates in column Q in sheet2 in the same workbook.

I need a vba code that will allow me to compare the two lists of rates and if there is a rate in column D sheet1 that does not exist in column Q sheet2 then I want to delete that entire row in sheet1.

Can you pls help? Is there some sort of loop or vlookup I can use?

Many thanks!
 
hey Peter,

It seems that when I copied the data into sheet2 using text import wizard and selecting Delimiters/Semicolon the data goes into the sheet with some spaces either side of some of the text in the colums!! I used the below code to take these spaces out and now your formula works fine

Sheets("sheet2").Select
With ActiveSheet.UsedRange
.Value = Evaluate("if(row(" & .Address & "), trim(" & .Address & "))")
End With

Thanks for all your help again peter!!
 
Upvote 0

Excel Facts

Can you AutoAverage in Excel?
There is a drop-down next to the AutoSum symbol. Open the drop-down to choose AVERAGE, COUNT, MAX, or MIN
When you do the Text to Columns, try selecting both Semicolon and Space as delimiters and also select 'Treat consecutive delimiters as one'. Then you may not need to use this last code.
 
Upvote 0

Forum statistics

Threads
1,224,507
Messages
6,179,183
Members
452,893
Latest member
denay

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