简体   繁体   中英

Excel 2003 Conditional Formatting(Changing text format)

Need some help on how to do conditional formatting on excel 2003. I have a cell that will have a text formatting depending on the selected list in excel.

eg

Selected Dropdown Item-------Cell Value

  1. Text------------------------------TEST123 <----------formatted as text
  2. Number--------------------------100,000.00 <-------formatted as number

I think that this can easily be done in excel newer than 2003 as conditional formatting displays the number tab where you can select the data type format but in 2003 it seems that its not available or I just can't find it.

Please help. Thanks

Are you looking for something like this?

=IF(ISNUMBER(D9),TEXT(D9,"#,##0.00"),TEXT(D9,""))

I'm not sure where you are getting the

TEST123

from. If it you are adding to it or just leaving it as plain text.

Update:

I see what you are asking now. As far as I know you can't conditional format a number in Excel 2003. I'll do a little searching. You can use VBA though. It would look like this:

set r1=selection
if isnumeric(r1.value2) then
  r1.NumberFormat="#,##0.00"
else
  r1.NumberFormat=""
end if

Update 2:

So I guess the question is then, are you added something to the text if it is text? If not just format the number and it will work fine.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM