View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Rick Rothstein Rick Rothstein is offline
external usenet poster
 
Posts: 5,934
Default Is there a way to use subscripts in my formulas?

No, you can't part of a cell's value be formatted differently from the rest
when using a formula. However, there is a VB solution that will do what you
want. However, you will need to lock down the range of cells the
functionality will apply to. In other words, when using VB event code, there
is no "copying down" type mechanism available when extending a functionality
across a range... you have to specify the entire range that could ever
possibly be involved before hand. So, tell us what the maximum range of
cells are where you would put your formula and how the formula is to apply
(E18 becomes E19 in next cell down, etc?) and we will try to write the event
code to do what you want. By the way, if the formula you posted is a
simplification for your actual formula, then you will need to tell us your
actual formula as the code will be specific written to duplicate what it
does.

--
Rick (MVP - Excel)


"Neil Cash" wrote in message
...
I use a lot of variables with subscripts. And would like the formatting to
follow the output when I put these in formulas.

i.e. =if(E180,"pr = 7","pr = 0")

I would like the "r" in pr be subscripted when it calculates the formula.
So far I've noticed that it removes all formatting when the formula
calculates. Is there a way around this?

Thanks in advance!