+ Reply to Thread
Results 1 to 3 of 3

Trouble with custom function that replicates a worksheet formula

  1. #1
    Forum Contributor
    Join Date
    04-11-2012
    Location
    Chicago, IL
    MS-Off Ver
    Excel 2010
    Posts
    245

    Trouble with custom function that replicates a worksheet formula

    Good morning -

    I'm trying to replicate a worksheet formula using VBA code. In short, I want to call a custom function to generate the same result I get with the worksheet formula. See may attached sample workbook which illustrates what I want to do.

    Thanks,
    Attached Files Attached Files
    Last edited by Grilleman; 04-18-2020 at 12:09 PM.

  2. #2
    Valued Forum Contributor Eastw00d's Avatar
    Join Date
    02-29-2020
    Location
    Breda, NL
    MS-Off Ver
    2016, 2019
    Posts
    833

    Re: Trouble with custom function that replicates a worksheet formula

    Hi, what if you amend your code a little like this:
    Please Login or Register  to view this content.
    Cheers
    Erwin
    Last edited by Eastw00d; 04-18-2020 at 02:00 PM.
    I started learning VBA because I was lazy ...
    Still developing.... being more lazy...

  3. #3
    Valued Forum Contributor
    Join Date
    08-03-2012
    Location
    Newcastle
    MS-Off Ver
    Excel 2007, 2010, 2013, 2016, Office 365
    Posts
    467

    Re: Trouble with custom function that replicates a worksheet formula

    Hi Grilleman

    maybe not understand exactly what you need, but this could do it..
    Please Login or Register  to view this content.
    ..when you switch to that sheet, the event code runs to first put the required formula into the required cell.
    ..then it replaces that formula with the computed value.

    ..see attached file

    zeddy
    Attached Files Attached Files

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Get worksheet name of cell using a custom function, rather than active worksheet?
    By Pedsdude in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 08-07-2014, 04:45 AM
  2. [SOLVED] Trouble using Custom function in an array to determine Cell Colour
    By karanm83 in forum Excel Formulas & Functions
    Replies: 5
    Last Post: 09-21-2012, 03:38 PM
  3. How do I run a custom function only when a worksheet is selected?
    By jack.x in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 06-18-2012, 01:59 AM
  4. Worksheet as custom function?
    By burro in forum Excel General
    Replies: 3
    Last Post: 11-10-2011, 08:14 PM
  5. Custom Function from worksheet result
    By tJasC3 in forum Excel Formulas & Functions
    Replies: 2
    Last Post: 06-04-2008, 04:24 AM
  6. add worksheet in custom function
    By djoella in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-10-2007, 05:53 PM
  7. [SOLVED] Activate a Worksheet from a Custom Function ??
    By monir in forum Excel Programming / VBA / Macros
    Replies: 5
    Last Post: 05-17-2005, 02:06 PM

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