Is there a way to have a format string (like '# ##0') in a cell and then base the number format of a range of other cells on the content of that cell?

I have a set of rows with dynamic formulas such that, depending on what the user selects in a drop-down list, the values should be formatted as either currency values or percentages.

If not, I will resort to VBA, but I just wanted to check if there's a VBA-less solution.

Thanks!