How to remove mail id from excel
There are a few ways to remove email addresses from Excel cells:
Method 1: Using the SUBSTITUTE
function
- Select the cell(s) containing the email addresses.
- Type the following formula:
=SUBSTITUTE(A1,"@","")
(assuming the email address is in cell A1). - Press Enter to apply the formula.
- The email address will be replaced with a blank string, effectively removing the
@
symbol and the domain name.
Method 2: Using the REGEXREPLACE
function (Excel 2013 and later)
- Select the cell(s) containing the email addresses.
- Type the following formula:
=REGEXREPLACE(A1,"[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}","")
(assuming the email address is in cell A1). - Press Enter to apply the formula.
- The email address will be replaced with a blank string, effectively removing the entire email address.
Method 3: Using the TEXT TO COLUMN
feature
- Select the cell(s) containing the email addresses.
- Go to the "Data" tab in the ribbon.
- Click on "Text to Columns".
- In the "Text to Columns" dialog box, select "Delimited Text" and click "Next".
- In the "Delimiters" section, select "Space" or "Other" and enter a space or the character you want to use to separate the email address from the rest of the text.
- Click "Finish" to apply the conversion.
- The email address will be split into two columns, with the email address in one column and the rest of the text in another column.
Method 4: Using a VBA macro
- Open the Visual Basic Editor by pressing
Alt + F11
or by navigating to "Developer" tab in the ribbon. - Create a new module by clicking "Insert" > "Module" or by pressing
Alt + F11
. - Paste the following code:
Sub RemoveEmailAddresses() Dim rng As Range Set rng = Range("A1:A10") ' adjust the range to your needs For Each cell In rng cell.Value = Replace(cell.Value, "@", "") Next cell End Sub
- Replace
A1:A10
with the range of cells containing the email addresses. - Run the macro by clicking "Run" or by pressing
F5
. - The email addresses will be removed from the cells.
Note: These methods may not work if the email addresses are formatted as text or if they contain special characters.