How to remove first comma from text string in Excel?
In this article, I introduce a Defined Function to remove first comma from a cell filled with text string in Excel as below screenshot shown.
- Reuse Anything: Add the most used or complex formulas, charts and anything else to your favorites, and quickly reuse them in the future.
- More than 20 text features: Extract Number from Text String; Extract or Remove Part of Texts; Convert Numbers and Currencies to English Words.
- Merge Tools: Multiple Workbooks and Sheets into One; Merge Multiple Cells/Rows/Columns Without Losing Data; Merge Duplicate Rows and Sum.
- Split Tools: Split Data into Multiple Sheets Based on Value; One Workbook to Multiple Excel, PDF or CSV Files; One Column to Multiple Columns.
- Paste Skipping Hidden/Filtered Rows; Count And Sum by Background Color; Send Personalized Emails to Multiple Recipients in Bulk.
- Super Filter: Create advanced filter schemes and apply to any sheets; Sort by week, day, frequency and more; Filter by bold, formulas, comment...
- More than 300 powerful features; Works with Office 2007-2019 and 365; Supports all languages; Easy deploying in your enterprise or organization.
To remove first comma from text string, except Defined Function, there is no built-in function to solve it in Excel.
1. Enable the sheet which you want to remove first comma from cells filled with strings, press Alt + F11 keys to open Microsoft Visual Basic for Applications window, click Insert > Module, and paste below code to the Module script. See screenshot:
Code: Remove first comma from string
Function RemoveCommaInQuotation(xStr As String) 'UpdatebyExtendoffice20160901 RemoveCommaInQuotation = WorksheetFunction.Substitute(xStr, ",", "", 1) End Function
2. Save the code and go back to the sheet, and enter this formula =RemoveCommaInQuotation(A1), press Enter key to get the result, and you can see only the first comma has been removed from the string. You can drag auto fill handle over the cells which needed this formula. See screenshot:
|Kutools for Excel: The 200 functions you must have in Excel, you can free download from here|