Reputation: 457
In excel I have many cells of number in a column formatted as text. I want to convert them into a formatting "number stored as text". I can do it for a single cell at a time by putting an apostrophe (') before the number and pressing enter. My problem is how to achieve this type of formatting for rest of the cell quickly. I have tried to create a new column as ="'"&A2 and copy, but it does not work.
In the attached figure I have converted cell A2 as number formatted as text by putting an ' before it and want to do the same for rest of the cell quickly.
Upvotes: 3
Views: 4340
Reputation: 7979
While it may not be the fastest solution, just select the cells you want to be text and set the formatting to text => hit alt + F11
In the "Immediate" window run:
for each x in selection.cells: x.value = format(x.text,"'@"): next
Upvotes: 3
Reputation: 60224
You can do this with a helper column. You'll need to know what the numberformat was before you formatted the column as text. Then just use that same format in this formula:
=TEXT(A1,"number_format")
eg:
=TEXT(A1,"General")
or
=TEXT(A1,"0")
Fill down as far as necessary.
Next, select the cells in the column with the formula and Edit-Copy
; Edit-Paste Special Values
This will replace the formula with the text result.
Upvotes: 1