Cleaning data

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 total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
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,224,802
Messages
6,181,054
Members
453,014
Latest member
Chris258

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