+ Reply to Thread
Results 1 to 2 of 2

Break-down required of UDF-function: fGetFirstButtonDate

  1. #1
    Registered User
    Join Date
    05-08-2013
    Location
    Acht, NL
    MS-Off Ver
    Excel 2016
    Posts
    26

    Cool Break-down required of UDF-function: fGetFirstButtonDate

    Hi,

    Since Excel2003 or Excel2007 (I am not sure) there is no calendar function anymore.
    So the last few years I have been trying to, somehow, recreate that calendar.
    The one I am using now works perfectly, but I need some help explaning a piece of code I retained from somewhere(?), but I can't break it down (so to speak).

    I am using the following UDF-functions in VBA Excel2016:
    Please Login or Register  to view this content.
    Please Login or Register  to view this content.
    This function is triggered by the following piece of code (see code in RED):
    Please Login or Register  to view this content.
    My question revolves around this piece of code: ((Day(p_dtThisDate) \ 7 + IIf(Day(p_dtThisDate) Mod 7 = 0, 0, 1)) * 7 + Format(p_dtThisDate, "w", vbTuesday))

    If the date is set to 17-01-2022 (January 17th) then the following values are 'calculated':

    VBA - Controls.jpg

    It ends in a calendar that looks like this:

    Calendar.jpg

    If someone could help me out, that would be awesome!
    Last edited by Irmaxx; 02-05-2022 at 11:18 AM. Reason: Bad grammar...
    Win10Pro 22H2 | Excel2016

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2406 Win 11 Home 64 Bit
    Posts
    24,035

    Re: Explanation required

    Administrative Note:

    Welcome to the forum.

    We would very much like to help you with your query, however the thread title does not really convey what your request is about. Tell us what you are trying to do, not how you think it should be done.

    Please take a moment to amend your thread title. Make sure that the title properly explains your request. Your title should be explicit and not be generic (this includes function names used without an indication of what you are trying to achieve).

    Please see Forum Rule #1 about proper thread titles and adjust accordingly. To edit the thread title, open the original post to edit and then click on Go Advanced (bottom right) to access the area where you can edit your title.

    (Note: this change is not optional. No help to be offered until this moderation request has been fulfilled.)
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

+ 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. My first try with loops...but it is not working... explanation required!
    By Alex Piotto in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 04-11-2018, 12:22 PM
  2. Testing if an object exists... explanation required
    By anrichards22 in forum Excel Programming / VBA / Macros
    Replies: 23
    Last Post: 12-28-2017, 06:10 AM
  3. [SOLVED] explanation required for HD serial no same on 3 different pc
    By JEAN1972 in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 07-26-2017, 10:06 AM
  4. VBA explanation required
    By ntljennifer in forum Excel General
    Replies: 2
    Last Post: 06-27-2014, 09:05 PM
  5. Multi Level Dependent Drop-down list, Explanation required
    By Shoieb.arshad in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 01-31-2012, 11:36 AM
  6. A better explanation of help required
    By Elvey in forum Excel General
    Replies: 3
    Last Post: 05-20-2006, 12:28 PM
  7. Simple explanation of formula required pls
    By Swn-Y-Mor in forum Excel General
    Replies: 4
    Last Post: 01-14-2005, 08:48 AM

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