View Single Post
  #1   Report Post  
twig
 
Posts: n/a
Default Problem with Date format from VBA code

I have written some VBA code to make a spreadsheet operate as a cash till.
I use the Now method to populate a cell for the till receipt date , and
cells in the Date column for a sales records worksheet. I format these cells
to be dd/mm/yyyy, as follows:
'--- use a cell to store todays date value
Range("CF.Date").Value = Now
<skip some lines
'--- post formatted date to sales record
c.Offset(1, 1).Value = Format(Range("CF.Date").Value, "dd/mm/yy")

Here's the problem:
The code works fine for every date after the twelfth of the month... but for
the first twelve days of each month the date appears in the cell in a
mm/dd/yy format.

Any ideas?