Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I am looking to use a function in VBA like =DATE(YEAR(NOW())-1,MONTH
(NOW()),DAY(NOW())) How can I do this? I tried: Application.WorksheetFunction.Date(Year(Now()) - 1, Month(Now ()), Day(Now())) without success. Thanks. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi,
Try this mynewtime = Format(DateAdd("yyyy", -1, Now), "dd/mm/yyyy") Mike " wrote: I am looking to use a function in VBA like =DATE(YEAR(NOW())-1,MONTH (NOW()),DAY(NOW())) How can I do this? I tried: Application.WorksheetFunction.Date(Year(Now()) - 1, Month(Now ()), Day(Now())) without success. Thanks. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jul 24, 9:08*am, "
wrote: I am looking to use a function in VBA like =DATE(YEAR(NOW())-1,MONTH (NOW()),DAY(NOW())) How can I do this? I tried: Application.WorksheetFunction.Date(Year(Now()) - 1, Month(Now ()), Day(Now())) without success. Thanks. Michael, Use DateSerial. Best, Matthew Herbert Dim myDate As Date myDate = DateSerial(Year(Date) - 1, Month(Date), Day(Date)) |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Excel Data Validation/Lookup function does function correcty | Excel Worksheet Functions | |||
copy of excel file not showing formulal/function in the function b | Excel Discussion (Misc queries) | |||
Excel - User Defined Function Error: This function takes no argume | Excel Programming | |||
Adding a custom function to the default excel function list | Excel Programming | |||
When I Import an Access Table With an Excel Function in a Cell it Displays as Text not as a Function in Excel | Excel Programming |