Next Tuesday Date using VBA Functions

VBA Next Tuesday

Next Tuesday Date:

Next Tuesday Date using Excel VBA Functions Now, DateAdd,Format and WeekDay. We have different methods and ways to find Next Tuesday date. You can find below three specified macros or procedures to find Next Tuesday date using VBA functions. i.e Now, DateAdd, WeekDay and Format.

We are trying to find Next Tuesday date based on currnt or today’s date. Lets say today’s date is 11th Dec 2018 and weekday is Tuesday then upcoming date of Tuesday should be 18th Dec 2018 and weekday is Tuesday. In this tutorial we have explained three methods to find Next Tuesday date.

Method1: Get Next Tuesday Date using VBA Functions

Let us see the first method to find Next Tuesday date.

'Method 1: Next Tuesday Date using Excel VBA Functions
Sub VBA_Find_Next_Tuesday_Method1()
    
    Dim dNext_Tuesday As Date

    dNext_Tuesday = DateAdd("d", -Weekday(Now) + 10, Now)

    MsgBox "If today's date is '" & Format(Now, "DD MMM YYYY") & "' then" & vbCrLf & _
    " Next Tuesday Date is : " & Format(dNext_Tuesday, "DD MMM YYYY"), vbInformation, "Next Tuesday Date"
    
End Sub

Method2: Get Next Tuesday Date using VBA Functions

Here is the second method to find Next Tuesday date.

'Method 2: Next Tuesday Date using Excel VBA Functions
Sub VBA_Find_Next_Tuesday_Method2()
    
    'Variable Declaration
    Dim dNext_Tuesday As Date
    
    dNext_Tuesday = Now + (10 - Weekday(Now))

    MsgBox "If today's date is '" & Format(Now, "DD MMM YYYY") & "' then" & vbCrLf & _
    " Next Tuesday Date is : " & Format(dNext_Tuesday, "DD MMM YYYY"), vbInformation, "Next Tuesday Date"
    
End Sub

Method3: Get Next Tuesday Date using VBA Functions

The third method to find Next Tuesday date.

'Method 3: Next Tuesday Date using Excel VBA Functions
Sub VBA_Find_Next_Tuesday_Method3()

    Dim dNext_Tuesday As Date
     
    dNext_Tuesday = DateAdd("ww", 1, Now - (Weekday(Now, vbTuesday) - 1))
    
    
    MsgBox "If today's date is '" & Format(Now, "DD MMM YYYY") & "' then" & vbCrLf & _
    " Next Tuesday Date is : " & Format(dNext_Tuesday, "DD MMM YYYY"), vbInformation, "Next Tuesday Date"
    
    
End Sub

Output Screenshot

You can find following output screenshot of above specified macros.
Next Tuesday Date

Instructions:

  • Open Visual Basic Editor by clicking Alt +F11
  • Goto code window by clicking F7
  • Copy any of the above specified procedure or macro
  • Paste above copied code in code window
  • Run macro by clicking F5 or Run command
  • You can see ouput on the screen
  • Find specified output screenshot above.

Related VBA Functions used in this article:

We have used DateAdd, Now, Weekday and Format VBA functions. Click on below specified links to learn more about VBA functions.

VBA DateAdd Function VBA Now Function VBA WeekDay Function VBA Format Function





Leave a Comment

Your email address will not be published. Required fields are marked *