Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dates
I Have a Problem with a Programme that I have created where when a button is
pressed it puts today's date into a cell however towards the start of every month it mixes up the date for example 06-apr-05 will be entered as 04-jun-05 how can I stop this from Happening? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dates
I'm betting you're trying to format the date in your code.
How about just putting the date in the cell, then format that cell: with activesheet.range("a1") .value = date .numberformat="dd-mmm-yy" end with (Although, I like to use 4 digit years!) Jason Zischke wrote: I Have a Problem with a Programme that I have created where when a button is pressed it puts today's date into a cell however towards the start of every month it mixes up the date for example 06-apr-05 will be entered as 04-jun-05 how can I stop this from Happening? -- Dave Peterson |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dates
Dave, This will not solve my problem because I've made sure the the cells
that get these dates have been properly formated to "dd-mmm-yy" however thanks for your reply. "Dave Peterson" wrote: I'm betting you're trying to format the date in your code. How about just putting the date in the cell, then format that cell: with activesheet.range("a1") .value = date .numberformat="dd-mmm-yy" end with (Although, I like to use 4 digit years!) Jason Zischke wrote: I Have a Problem with a Programme that I have created where when a button is pressed it puts today's date into a cell however towards the start of every month it mixes up the date for example 06-apr-05 will be entered as 04-jun-05 how can I stop this from Happening? -- Dave Peterson |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dates
It sure sounds like excel is interpretting your value differently than you want.
If you remove that decision from excel by just assigning the date, you may find it works better. Did you try it? Jason Zischke wrote: Dave, This will not solve my problem because I've made sure the the cells that get these dates have been properly formated to "dd-mmm-yy" however thanks for your reply. "Dave Peterson" wrote: I'm betting you're trying to format the date in your code. How about just putting the date in the cell, then format that cell: with activesheet.range("a1") .value = date .numberformat="dd-mmm-yy" end with (Although, I like to use 4 digit years!) Jason Zischke wrote: I Have a Problem with a Programme that I have created where when a button is pressed it puts today's date into a cell however towards the start of every month it mixes up the date for example 06-apr-05 will be entered as 04-jun-05 how can I stop this from Happening? -- Dave Peterson -- Dave Peterson |
#5
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dates
On Tue, 5 Apr 2005 18:33:02 -0700, "Jason Zischke"
wrote: Dave, This will not solve my problem because I've made sure the the cells that get these dates have been properly formated to "dd-mmm-yy" however thanks for your reply. Yes -- but how is your programming outputting the result. Unless the output is a number, which Excel can then interpret as a date, formatting will have no affect. --ron |
#6
Posted to microsoft.public.excel.programming
|
|||
|
|||
Dates
Formatting the cell has no effect on how VBA interprets the date when
placing a value in the cell. Post your code and perhaps someone can show you how to remove the problem. -- Regards, Tom Ogilvy "Jason Zischke" wrote in message ... Dave, This will not solve my problem because I've made sure the the cells that get these dates have been properly formated to "dd-mmm-yy" however thanks for your reply. "Dave Peterson" wrote: I'm betting you're trying to format the date in your code. How about just putting the date in the cell, then format that cell: with activesheet.range("a1") .value = date .numberformat="dd-mmm-yy" end with (Although, I like to use 4 digit years!) Jason Zischke wrote: I Have a Problem with a Programme that I have created where when a button is pressed it puts today's date into a cell however towards the start of every month it mixes up the date for example 06-apr-05 will be entered as 04-jun-05 how can I stop this from Happening? -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Linking computer dates (time) to spreadsheet dates that have formu | Excel Worksheet Functions | |||
Stop dates from showing as numbers - when formated as dates | Excel Discussion (Misc queries) | |||
compare 2 tables of dates to find the preceding dates | Excel Worksheet Functions | |||
Toggle a range of Julian dates to Gregorian Dates and Back | Excel Programming | |||
Charting data against dates where dates are not at fixed intervals | Charts and Charting in Excel |