Results 1 to 8 of 8

Why Does Custom Function in Name Get Called Twice?

Threaded View

johnywhy Why Does Custom Function in... 07-20-2014, 06:56 PM
mongoose36 Re: Why Does Custom Function... 07-20-2014, 10:21 PM
johnywhy Re: Why Does Custom Function... 07-21-2014, 02:34 AM
mikerickson Re: Why Does Custom Function... 07-21-2014, 02:42 AM
johnywhy Re: Why Does Custom Function... 07-21-2014, 02:49 AM
coolblue Re: Why Does Custom Function... 07-21-2014, 04:00 AM
romperstomper Re: Why Does Custom Function... 07-21-2014, 03:30 AM
Andy Pope Re: Why Does Custom Function... 07-21-2014, 03:39 AM
  1. #1
    Registered User
    Join Date
    12-10-2010
    Location
    California
    MS-Off Ver
    Excel all versions from 5.0 (1993) to 365
    Posts
    38

    Why Does Custom Function in Name Get Called Twice?

    Hi

    My VBA code looks like this:

    Function TestInfo(R As Range) As String    
        MsgBox "alert"    
        TestInfo = R.Address
    End Function
    My worksheet has two defined names:

    TestCell refers to "=$E$7"

    TestRef refers to "=TestInfo(TestCell)"

    To duplicate the unexpected double-call, enter the following in the VBA immediate pane:
    Application.EnableEvents = False
    Application.Calculation = xlCalculationManual
    ?[TestRef]
    as expected, the address of TestCell is printed in the immediate pane once.

    However, the msgbox alert is unexpectedly displayed TWICE.

    Why?

    Note, the alert is displayed twice with or without setting EnableEvents and Calculation-- they make no difference.

    Thx.

    (also posted here)
    Last edited by johnywhy; 07-20-2014 at 06:59 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Why is a custom function running when it is not called.
    By Rob K in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 06-02-2014, 07:37 AM
  2. [SOLVED] Userform code fails when the userform is called from a custom ribbon button
    By klonbeck in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 03:00 PM
  3. Replies: 0
    Last Post: 02-21-2013, 08:28 AM
  4. Need to know what cell called the custom VBA function?
    By partyOfOne in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 09-19-2005, 01:05 PM
  5. [SOLVED] Custom Function being called when it shouldn't.
    By Ron in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 01-18-2005, 04:06 PM

Tags for this Thread

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