I am trying to format a cell as text using a macro.
I have a macro that runs based off a combo (drop-down) box. If a user selects a customer ID number from the combo box, the macro then populates certain locked cells with vlookup formulas that retrieve name and addresses (scenario 1). For customers without ID numbers the user selects "New Customer" from the combo box and the cells become unlocked. Users can now manually input name and addresses themselves (scenario 2).
The issue I'm having is with the zip code field. If I format the field as text, using scenario 1, the formula is simply placed into the cell as text. If I format it as "General" then, using scenario 2, any zip code beginning with "0" has the leading "0" dropped off (excel thinks it's a number).
Is there anything I can include in the macro code along the lines of {cell.format = text}?
Thanks in advance for you help.