aboutsummaryrefslogtreecommitdiff
path: root/challenge-138/eric-cheung/excel-vba/ch-1.bas
blob: c47517534be784c8a4fe1694ebc5fd3bc8eb76e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
Attribute VB_Name = "ModTask_01"
Option Explicit

Public Const strMyTitle As String = "Eric Cheung"

Sub Task_01()

    '' Const nInputYear As Integer = 2021 '' Example 1
    Const nInputYear As Integer = 2020 '' Example 2

    Dim strMsg As String
    
    strMsg = CStr(Application.WorksheetFunction.NetworkDays(DateSerial(nInputYear, 1, 1), DateSerial(nInputYear, 12, 31)))
    
    MsgBox strMsg, vbOKOnly, strMyTitle
    
End Sub