Browse
 
Tools
Categories

Excel How To's

Author: Steve Childs Reference Number: AA-02198 Created: 2014-09-09 14:58 Last Updated: 2021-04-20 06:50 0 Rating/ Voters


How to Add/insert  Apostophe In front of numbers in Excel?

The following simple code may help you to insert apostrophe before each number in a selection, please do as follows:

1. Select the range of numbers that you want to add the apostrophe.

2. Hold down the ALT + F11 keys to open the Microsoft Visual Basic for Applications window.

3. Then click Insert > Module, and paste the following code in the Module window.

VBA code: Insert apostrophe in front of numbers at once:

1
2
3
4
5
6
Sub Addapostrophe()
'updateby Extendoffice 20151207
For Each cell In Selection
cell.Value = "'" & cell.Value
Next cell
End Sub

4. After pasting the code, then press F5 key to run this code, and the apostrophe has been inserted in front of the numbers at once.

https://www.extendoffice.com/documents/excel/3356-excel-insert-leading-apostrophe.html