View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Sheeloo[_3_] Sheeloo[_3_] is offline
external usenet poster
 
Posts: 1,805
Default Transfer Multiple-Font Cells ??

You can not do this using a User Defined Function (UDF) since "UDF cannot
alter the structure or format of a worksheet or cell."

You need to develop a logic using
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
to change the format based on a condition...

We can try to build one for you if you can tell us the logic (under what
conditions to format the first character, or for which cells?

"monir" wrote:

Hello;

I did post this question earlier (with the same Subject) at MrExcel forum.
A single respondent DaveMeade (who has put a considerable effort and still
trying) and myself have tested few ideas but nothing has worked so far.
The lack of responses suggests the solution is either too simple or too
complex!!
By reposting in this MS Excel DG (and I apologise if this is considered by
some as cross-posting!) the chances of a MS expert providing the solution
increases considerably.
My earlier thread is located at:
http://www.mrexcel.com/forum/showthr...9&goto=newpost

Here's the problem description:
1) Numerous cells in columns A and B on a w/s have a combination of two
fonts each.
For example, cell A5 shows: & 15 on the Formula Bar. The & sign is in
"Wingdings 3" Font code 38, and 15 is in "Arial".
Cell A5 correctly displays: | 15 (i.e.; north east arrow,space,15).
The "wingdings 3" char is always the first char followed by a space followed
by a single- or double-digit number.

2) Other cells on the w/s reference those cells.
For example, cell C5:: = IF($J$41= "Vortex", A5, B5)

Q: When the above condition is true: Is there a way to return | 15 (i.e.;
north east arrow,space,15) in C5, exactly as displayed in A5 ??

3) DaveMeade suggested the following, but it didn't work!!
C5:: =IF($J$41="Vortex",WingDingFormat(A5), B5)

Function WingdingFormat(rng As Range)
WingdingFormat = rng.Value
ActiveCell.Characters(Start:=1, Length:=1).Font.Name = "Wingdings 3"
End Function

4) The above approach appears to have the potential of solving the problem
with some expert tweaking!

Your help would be greatly appreciated.

Thank you kindly.