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

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.
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
 
Upvote 0
Glad to help & thanks for the feedback
 
Upvote 0

Forum statistics

Threads
1,214,415
Messages
6,119,382
Members
448,889
Latest member
TS_711

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