Excel, add a character to the entire column

cyf3888 -  
eriiic Posted messages 24581 Registration date   Status Contributeur Last intervention   -
Hello,
I would like a formula that can add the character " ' " at the beginning of the entire column C
example: C1 = 145875465 C2 = 145878989
desired result: C1 = '145875465 C2 = '145878989
thank you in advance

Configuration: Windows 7 / Chrome 25.0.1364.172

2 réponses

via55 Posted messages 14730 Registration date   Status Membre Last intervention   2 755
 
Good evening

In a different cell, for example in D
=" ' " & C1

or by macro to modify column C

Sub ajout()
For n = 1 To 50 ' goes from line 1 to 50, adjust if longer or shorter
a = Cells(n, 3).Value
b = " ' " & a
Cells(n, 3).Value = b
Next
End Sub

ALT F11 to open the editor Select the sheet and paste the code in the right window

Close the editor and in the sheet, run the macro: Developer tab Macros Run

Best regards
9