Skip to content

Instantly share code, notes, and snippets.

@ateneva
Created July 21, 2018 21:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ateneva/dd3ae671cea1c5bb21f7817aa4d2eb38 to your computer and use it in GitHub Desktop.
Save ateneva/dd3ae671cea1c5bb21f7817aa4d2eb38 to your computer and use it in GitHub Desktop.
How do I quickly re-map values with VBA?
Sub ReplaceConstantValues()
Dim Cell As Range
For Each Cell In ActiveSheet.Range("E2:E" & ActiveSheet.UsedRange.Rows.Count).SpecialCells(xlCellTypeVisible)
Cell.Replace " USA", "USA"
If Cell.Value = "Nederland" Then Cell.Value = "Netherlands"
If Cell.Value = "Luxemburg" Then Cell.Value = "Luxembourg"
Next Cell
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment