Results 1 to 6 of 6
  1. #1
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Custom Function (XL97;SR2)

    Is it possible to create a custom funtion to make the returned value/text bold?

    Example:
    A1 = Cat 'Font is regular

    A custom function such as CFunction(A1) would return "Cat" with the font being "bold".

  2. #2
    Uranium Lounger
    Join Date
    Dec 2000
    Location
    Salt Lake City, Utah, USA
    Posts
    9,508
    Thanks
    0
    Thanked 6 Times in 6 Posts

    Re: Custom Function (XL97;SR2)

    You can 'get' font attributes with a UDF, but to 'set' them you have to use a worksheet change event. It's easier to use Conditional Formatting where possible, see <post#=39851>post 39851</post#>, subject to a three-condition limit. A manual alternative is to filter the list/table for "cat" then Edit, GoTo, Special, Visible Cells Only, then format those relevant visible cells Bold.

    Will one of these work for you?
    -John ... I float in liquid gardens
    UTC -7ąDS

  3. #3
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Function (XL97;SR2)

    My ultimate goal is to us the bold feature in a concatenation. Example: A1 = Cat B1= or Dog

    The concatenation would be: =Concatenate(A1,B1) and the displayed result would be Cat or Dog

    The conditional format would not work as the returned values/text are different for each cell.

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Custom Function (XL97;SR2)

    Have a look at the long thread starting at <post#=128269>post 128269</post#>. You'll find a macro by Pieterse, later expanded by kjktoo, that may help.

  5. #5
    WS Lounge VIP rory's Avatar
    Join Date
    Dec 2000
    Location
    Burwash, East Sussex, United Kingdom
    Posts
    6,280
    Thanks
    3
    Thanked 191 Times in 177 Posts

    Re: Custom Function (XL97;SR2)

    Hi,
    As John said, you can't set this with a UDF. You would need to use a subroutine (or event that triggers a subroutine) and use the Range.Characters property to set the relevant characters to a bold font.
    Hope that helps.
    Regards,
    Rory

    Microsoft MVP - Excel

  6. #6
    Silver Lounger
    Join Date
    Dec 2000
    Location
    California, USA
    Posts
    1,758
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Custom Function (XL97;SR2)

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •