Home |
Search |
Today's Posts |
|
#1
![]() |
|||
|
|||
![]()
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? |
#2
![]() |
|||
|
|||
![]()
Hi
use c.Offset(1, 1).Value =Range("CF.Date").Value and use the numberformat property for your format -- Regards Frank Kabel Frankfurt, Germany "twig" schrieb im Newsbeitrag ... 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? |
#3
![]() |
|||
|
|||
![]()
Thanks Frank, that cured it
|
#4
![]() |
|||
|
|||
![]()
Hi
You could also make sure that in the control panel, regional and language options that the short date is set correctly for what you want.(win xp, May be found under time and date settings or elsewhere in win 98.) HTH Ken |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Problem with date base units for x axis | Charts and Charting in Excel | |||
Problem Code: Retrieving Stored Access 03 Query | Excel Discussion (Misc queries) | |||
cut and paste format problem | Excel Discussion (Misc queries) | |||
Date on two lines using a custom cell format possible? | Excel Discussion (Misc queries) | |||
How can I format a cell so date field only displays the Month? | Excel Discussion (Misc queries) |