I have a list of data without 0, so I tried
Format Cells->Custom
to add a leading zero and it works.
But when I click every single cell, the data shown in formula bar still didn’t have the leading zero. For example, in my excel file after custom formatting:
0112244555
But in the formula bar:
112244555
Is there any way to display data with leading zeros as well when I click each of them?
Removing leading zeroes is default behaviour in Excel.
Your work-around to use a Custom format is standard to show leading zeroes
If you want to actually embed them then you will need to add an apostrophe
ie in A1
'012will display
012
as text – although you can still perform algebraic manipulation on this cell as if it was entered as a numeric
12Code Solution
This code will:
So if you ran the code on column A below, the result would be the updated cells shown in column C (for demonstration only, the actual updates occur in A1,A4 and A5)
Change this line
strRep = "'00"to change the amount of leading zeroes