View Full Version : puting an apostrophe before a number
2011-05-13, 03:09 PM
how do you format numbers to have an apostrophe before all the numbers
eg. 100 '100
the are too many of the numbers and can not do it manually, looking for the formula
2011-05-13, 05:13 PM
Public Sub ProcessData()
Dim Lastrow As Long
Dim i As Long
Application.ScreenUpdating = False
Lastrow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = 1 To Lastrow
If IsNumeric(.Cells(i, "A").Value) Then
.Cells(i, "A").Value = "'" & .Cells(i, "A").Value
Application.ScreenUpdating = True
2011-05-18, 04:43 AM
Bob's route will actually put an apostrophe in the cell. If you want them to just look like they have an apostrophe, but still work like numbers, you can use a custom number format:
Select the range of cells
Right click and choose "Format Cells"
Go to the "Number" tab
Under "Type" enter the '0
This will display with the apostrophe, but you can still add and subtract them if you need to.
Powered by vBulletin® Version 4.2.0 Copyright © 2013 vBulletin Solutions, Inc. All rights reserved.