+ Reply to Thread
Results 1 to 3 of 3

Updating a cell from a function

  1. #1
    Registered User
    Join Date
    10-11-2011
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    2

    Updating a cell from a function

    I have searched and found nothing to lead me to what I am doing wrong so I must ask a question that appears to have been asked before, though I believe my question is slightly different. The question as asked originally (by someone else) can be found in the thread "VBA How do I set a value in a cell?".

    I have a function that is invoked with the following formula in a cell:

    =IF(H313="Y",CreateAppointment(B313,B314,A313,"On-Call Schedule",H313),"")

    H313 can be any cell on the spreadsheet, but the purpose is to trigger the execution of the function CreateAppointment.
    B313 and B314 are the names of the primary and secondary support personnel for the week.
    A313 contains the date of the first day of the support week.
    "On-Call Schedule" is the name of an outlook calendar that is to have a event inserted containing the support personnel names, etc.

    The H313 is the cell identification of the cell containing the trigger flag.

    The idea here is that when CreateAppointment is invoked, if the primary and secondary support names are non-blank, and the support date is also non-blank, then an outlook event will be inserted into the designated calendar and a result of "Done" is returned as the function result. Additionally, I want the function to clear the trigger cell, which is why the cell reference appears as the 5th argument to the function.

    The outlook functionality works just fine, what is not working is the clearing of the trigger cell.

    In the above referenced thread, it appears that the end result was to create a function that invoked a subroutine and the original poster, I believe, indicated that it solved the problem. I have created a similar function/subroutine combination as follows and I cannot make it work. If I comment out the last line before the "End Sub", the processing completes, the function returns "Done" to the cell within which it is coded, but the trigger cell remains "y". If I uncomment out the instruction, the process ends up with #VALUE in the cell where the function is coded.

    Please Login or Register  to view this content.
    Last edited by TheMadWookie; 09-29-2014 at 08:56 PM.

  2. #2
    Forum Guru
    Join Date
    03-02-2006
    Location
    Los Angeles, Ca
    MS-Off Ver
    WinXP/MSO2007;Win10/MSO2016
    Posts
    12,663

    Re: Updating a cell from a function

    Please edit your post. The tags are: [CODE]Please [url=https://www.excelforum.com/login.php]Login or Register [/url] to view this content.[/CODE] not <code></code>
    Ben Van Johnson

  3. #3
    Registered User
    Join Date
    10-11-2011
    Location
    Minnesota
    MS-Off Ver
    Excel 2010
    Posts
    2

    Re: Updating a cell from a function

    Thanks, I was wondering why it didn't get "boxed" when I posted.

+ 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. Replies: 16
    Last Post: 04-25-2013, 03:12 PM
  2. Help with automatic chart updating/auto updating today function
    By Tux2424 in forum Excel Charting & Pivots
    Replies: 0
    Last Post: 09-26-2012, 04:45 PM
  3. Cell Function not updating on Monday
    By realniceguy5000 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 05-24-2010, 10:51 AM
  4. Vba function not updating
    By Zaeguzah in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 12-30-2009, 04:59 AM
  5. Updating a cell that uses a .NET add-in function
    By [email protected] in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 06-07-2006, 04:35 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