Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Column "D" has random date values in cells
I need to retrieve the min and max dates from this column and store values in a varible. I have tried the following: Dim d1 As Date Application.Min (Application.Index(d1, 0, 4)) '4=column D This just returns a time stamp |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try,
mydatemax = Format(WorksheetFunction.Max(Range("a1:a10")), "dd mm yyyy") mydatemin = Format(WorksheetFunction.Min(Range("a1:a10")), "dd mm yyyy") Mike "miek" wrote: Column "D" has random date values in cells I need to retrieve the min and max dates from this column and store values in a varible. I have tried the following: Dim d1 As Date Application.Min (Application.Index(d1, 0, 4)) '4=column D This just returns a time stamp |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks This worked fine.
I used: d1 = Format(WorksheetFunction.Max(Range("d:d")), "mm/dd/yyyy") "Mike H" wrote: Try, mydatemax = Format(WorksheetFunction.Max(Range("a1:a10")), "dd mm yyyy") mydatemin = Format(WorksheetFunction.Min(Range("a1:a10")), "dd mm yyyy") Mike "miek" wrote: Column "D" has random date values in cells I need to retrieve the min and max dates from this column and store values in a varible. I have tried the following: Dim d1 As Date Application.Min (Application.Index(d1, 0, 4)) '4=column D This just returns a time stamp |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
With dates in column D:
Sub dated() x = Application.WorksheetFunction.Max(Range("D:D")) MsgBox (Format(x, "mm/dd/yyyy")) End Sub and similar for the min. This is because Dates are really just numbers with a fancy format! -- Gary''s Student - gsnu200781 "miek" wrote: Column "D" has random date values in cells I need to retrieve the min and max dates from this column and store values in a varible. I have tried the following: Dim d1 As Date Application.Min (Application.Index(d1, 0, 4)) '4=column D This just returns a time stamp |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks This worked fine.
I used: d1 = Format(WorksheetFunction.Max(Range("d:d")), "mm/dd/yyyy") "Gary''s Student" wrote: With dates in column D: Sub dated() x = Application.WorksheetFunction.Max(Range("D:D")) MsgBox (Format(x, "mm/dd/yyyy")) End Sub and similar for the min. This is because Dates are really just numbers with a fancy format! -- Gary''s Student - gsnu200781 "miek" wrote: Column "D" has random date values in cells I need to retrieve the min and max dates from this column and store values in a varible. I have tried the following: Dim d1 As Date Application.Min (Application.Index(d1, 0, 4)) '4=column D This just returns a time stamp |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How can I convert column of dates to Hebrew dates | Excel Discussion (Misc queries) | |||
how do I sort a column of random dates into Consecutive dates | Excel Worksheet Functions | |||
How to count dates in a column between 2 dates | Excel Programming | |||
How do I sum #s in a column based on dates in another column | Excel Discussion (Misc queries) | |||
Formula help for counting,with a column of dates and a column of n | Excel Worksheet Functions |