Home |
Search |
Today's Posts |
#6
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks to both of you.
Yes Bob. There may be multiple occurances as well as nil occurances. I tried your code with do loop but it does not work, gives very vague results. I don't know why it works that way with do loop. Dave - I have added one If Not IsEmpty(CELL) Then statement to skip blank cells. Your code works fine as long as there is atleast one occurance. If the cell does not contain HL then 1st part to replace is skipped by If pos = 0 Then Exit Do End If But, 2nd part is still executed. Its a for loop. For pCtr = LBound(myPositions) To UBound(myPositions) CELL.Characters(myPositions(pCtr), 1).Font.NAME = "wingding 2" CELL.Characters(myPositions(pCtr), 1).Font.Bold = True Next pCtr There are two things. 1. If 1st cell is with nil occurance, then code breaks on error highlighting above for loop (subscript out of range). 2. If If any subsequent cell is with nil occurance, then above for loop changes the font of any other cherecter making it unreadable. I tried to bypass this for loop with a goto statement. If pos =0 then goto ncell ....code ncell: next cell end sub With this, cells with nil occurance are not changed but the replacement made in cells containing HL are not applied new font. I hope, this also can be solved or a workaround is possible. Regards, Shetty. |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How to mix fonts in a cell? | Excel Discussion (Misc queries) | |||
Search/Match/Find ANY part of string to ANY part of Cell Value | Excel Worksheet Functions | |||
Is it possible to use 2 different fonts in 1 excel cell? | Excel Discussion (Misc queries) | |||
How can I lengthen the drop down Fonts list to show more fonts at | Excel Discussion (Misc queries) | |||
2 different fonts in a cell | Excel Discussion (Misc queries) |