+ Reply to Thread
Results 1 to 2 of 2

Help: UDF Used in Conditional Format not Initialized

  1. #1
    Dan
    Guest

    Help: UDF Used in Conditional Format not Initialized

    I am using a simple UDF in a module:

    Option Explicit
    Function GetFormula(Cell As Range) As String
    GetFormula = Cell.Formula
    End Function

    This UDF is only used in a conditional format to let me know if someone has
    replaced the default formula in a cell with a hardcoded value.

    When I open the workbook, Excel seems to forget to initialize the UDF and
    the formats are not shown. If I open the module and make a change to the
    code or use the function regularly in a cell then suddenly all the
    conditional formats start working.

    Any thoughts on how to make this more robust so it works as soon as I open
    the workbook?

    Thanks in advance,



  2. #2
    Dave Peterson
    Guest

    Re: Help: UDF Used in Conditional Format not Initialized

    Maybe...

    Add

    application.calculate

    to your auto_open/workbook_open code?

    Dan wrote:
    >
    > I am using a simple UDF in a module:
    >
    > Option Explicit
    > Function GetFormula(Cell As Range) As String
    > GetFormula = Cell.Formula
    > End Function
    >
    > This UDF is only used in a conditional format to let me know if someone has
    > replaced the default formula in a cell with a hardcoded value.
    >
    > When I open the workbook, Excel seems to forget to initialize the UDF and
    > the formats are not shown. If I open the module and make a change to the
    > code or use the function regularly in a cell then suddenly all the
    > conditional formats start working.
    >
    > Any thoughts on how to make this more robust so it works as soon as I open
    > the workbook?
    >
    > Thanks in advance,


    --

    Dave Peterson

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1