Saturday, October 29, 2016

How to use the FORMAT Function with Dates (VBA)

How to use the FORMAT Function with Dates (VBA)
  • Example
    • Dim LValue As String
    • LValue = Format(Date, "yyyy/mm/dd")
  • Format ( expression, [ format, [ firstdayofweek, [firstweekofyear] ] ] )
  • Format(#17/04/2004#, "Short Date")
    • Result: '17/04/2004'
  • Format(#17/04/2004#, "Long Date")
    • Result: 'April 17, 2004'
  • Format(#17/04/2004#, "yyyy/mm/dd")
    • Result: '2004/04/17'

No comments:

Post a Comment