View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Rob van Gelder[_4_] Rob van Gelder[_4_] is offline
external usenet poster
 
Posts: 1,236
Default Passing Excel formats in VBA date variables


Yes, you would use the format function when you wanted to show the date as a
string.
eg.

Sub test()
Dim dtmTemp As Date

dtmTemp = Now()

MsgBox dtmTemp 'automatically formats as defined by regional settings

MsgBox Format(dtmTemp, "dd-Mmm-yyyy HH:mm")
End Sub




--
Rob van Gelder - http://www.vangelder.co.nz/excel


"ExcelMonkey " wrote in message
...
If I want to format it do I use a format function or a format method on
the vba variable?


---
Message posted from http://www.ExcelForum.com/