MadHatsJess

New Member
Joined
Jul 12, 2017
Messages
27
Hi

I have a very large data set with customer nationalities. I need to clean the nationalities up as there are several variations.

For example France should be French, British National should be British.

I can easily do this however I will be refreshing the data daily and am looking for an automated way.

I have made a table listing "From and To".

Can anyone help?

I was thinking of recording a macro and using the find and replace function but I think it would take too long as the list is quite big. (I am not the best with Macros so couldn't write it)

Thanks :)
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
74,437
Office Version
  1. 365
Platform
  1. Windows
How about
Code:
Sub ReplaceDetails()
   Dim ary As Variant
   Dim i As Long
   
   With Sheets("List")
      ary = .Range("A2", .Range("A" & Rows.Count).End(xlUp).Offset(, 1))
   End With
   
   With Sheets("Data")
      For i = 1 To UBound(ary)
         .Range("E:E").Replace ary(i, 1), ary(i, 2), xlWhole, , False, , False, False
      Next i
   End With
End Sub
As you haven't given much detail, you'll need to change sheet names & ranges to suit
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
74,437
Office Version
  1. 365
Platform
  1. Windows
Glad to help & thanks for the feedback
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,167,274
Messages
5,853,018
Members
431,540
Latest member
Hermione9908

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
Top