Select your cell go to Formats > Custom > enter 0000

If the cell you've just formated is a formula referncing another cell you have formatted to text it wont work.