ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   datepicker on 1904 date spreadsheet (https://www.excelbanter.com/excel-programming/339044-datepicker-1904-date-spreadsheet.html)

Basil

datepicker on 1904 date spreadsheet
 
Hiya,

I am using a datetime picker from a userform and on change I populate a cell
on a spreadsheet which is using the 1904 date system (this is because it
needs to be able to view negative times).

The problem is that when the date is transferred from the date picker to the
spreadsheet, it is 4 years and 1 day forward of what it should be. Is there a
way of changing the date picker / VB times so that they are in the 1904
system?

Thanks,

Basil

Dave Peterson

datepicker on 1904 date spreadsheet
 
Maybe just subtract 1462 before you assign the value to the cell?

Basil wrote:

Hiya,

I am using a datetime picker from a userform and on change I populate a cell
on a spreadsheet which is using the 1904 date system (this is because it
needs to be able to view negative times).

The problem is that when the date is transferred from the date picker to the
spreadsheet, it is 4 years and 1 day forward of what it should be. Is there a
way of changing the date picker / VB times so that they are in the 1904
system?

Thanks,

Basil


--

Dave Peterson

Basil

datepicker on 1904 date spreadsheet
 
Thanks Dave,

I actually tried that and it was subtracting 8 years instead of 4! At that
point I realised that I needed to add '.Value' after my object name to make
the spreadsheet undertsand the correct date. A bit of a weird one, but sorted
now.

Thanks for looking into it mate.

Basil

"Dave Peterson" wrote:

Maybe just subtract 1462 before you assign the value to the cell?

Basil wrote:

Hiya,

I am using a datetime picker from a userform and on change I populate a cell
on a spreadsheet which is using the 1904 date system (this is because it
needs to be able to view negative times).

The problem is that when the date is transferred from the date picker to the
spreadsheet, it is 4 years and 1 day forward of what it should be. Is there a
way of changing the date picker / VB times so that they are in the 1904
system?

Thanks,

Basil


--

Dave Peterson



All times are GMT +1. The time now is 10:47 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com