Sometimes, you may need to sanitize your data before sharing your file. The below macro would sanitize the data and since this is completely based on random generation, hence, it can not be recreated.

Make sure that you have a copy of the Excel sheet before you sanitize or mask or anonymize the data by running this data. As once done, the data can not be recreated.

The Excel file related to this article can be downloaded from Data Masking Macro

1. Make a backup of your workbook.
2. Open your workbook and ALT+F11
3. Locate your Workbook name in Project Explorer Window
4. Right click on your workbook name > Insert > Module
5. Copy paste the Macro code given.
6. Select the Range which you want to anonymize
7. Go back to your Workbook and ALT+F8 to display Macro Window
8. Run your Macro from here
9. Delete you Macro if the Macro was needed to be run only once.
10. Otherwise save your file as .xlsm if you intend to reuse Macro again.

(Note - You may choose to save this macro in your personal macro workbook so that this macro is always available to you)