How to write a formula to set the Font Style?
Does anyone know how to write a formula to set the Font Style based on the
text language under specific cells? For example, in cell A1, there is some english text, then I would like to use the font "Arial" with size 8. However, if there is some chinese text in cell A1, then I would like to use font "XYZ" with size 15. Does anyone have any suggestions on how to write a formula to determine the text in order to set the text styles? Thank you for any suggestions Eric |
How to write a formula to set the Font Style?
I think it's not Easy. there is no such property of language ID for a cell's value. However, you could add some code on Worksheet_SelectionChange event to capture any change in cells then check for cell's value in the sheet. if it is a text then to check whether the first letter belong to A-Z, use select case will be a good idea. if it is a chinese, it will return "?" but you cannot use ? as a identifier. then you perform formatting in the ActiveCell.format property. hope this help. by the way, are you in HK? Leung "Eric" wrote: Does anyone know how to write a formula to set the Font Style based on the text language under specific cells? For example, in cell A1, there is some english text, then I would like to use the font "Arial" with size 8. However, if there is some chinese text in cell A1, then I would like to use font "XYZ" with size 15. Does anyone have any suggestions on how to write a formula to determine the text in order to set the text styles? Thank you for any suggestions Eric |
How to write a formula to set the Font Style?
Thank you for your reply
Could you please give me any example on how to do it? Yes, I am in HK Thank you for your suggestions Eric "Leung" wrote: I think it's not Easy. there is no such property of language ID for a cell's value. However, you could add some code on Worksheet_SelectionChange event to capture any change in cells then check for cell's value in the sheet. if it is a text then to check whether the first letter belong to A-Z, use select case will be a good idea. if it is a chinese, it will return "?" but you cannot use ? as a identifier. then you perform formatting in the ActiveCell.format property. hope this help. by the way, are you in HK? Leung "Eric" wrote: Does anyone know how to write a formula to set the Font Style based on the text language under specific cells? For example, in cell A1, there is some english text, then I would like to use the font "Arial" with size 8. However, if there is some chinese text in cell A1, then I would like to use font "XYZ" with size 15. Does anyone have any suggestions on how to write a formula to determine the text in order to set the text styles? Thank you for any suggestions Eric |
All times are GMT +1. The time now is 11:14 AM. |
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com