VBA Date Function

DATE

In excel vba we use date function to get current system date. Just like today() function in excel worksheet.

 

हम Date Function का उपयोग excel vba में current system date पाने के लिए करते हैं. ठीक उसी तरह जैसे excel worksheet पर today() function का use करते हैं.


If we have to show current date in message box, then we have to use below vba coding.

अगर हमें current date message box में show करना हैं तो हमें निचे लिखे vba code का प्रयोग करते हैं.

Sub date1()
MsgBox Date
End Sub


If we want to put current date with vba macro in A1 cell, then we have to use below vba coding.

अगर हम current date एक्सेल शीट पर A1 Cell पर vba coding से लाना चाहते हैं तो हमें निचे लिखे vba code का प्रयोग करते हैं.

Sub date2()
Range(“a1”).Value = Date
End Sub

 

Download Practice File