Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
In a range of selected cells, I want to find and store the minimum date in a
variable called MinDate, and the maximum date in a variable called MaxDate. How do I do that? Thanks! -- Steve C |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
On Jun 18, 7:43 am, Steve C wrote:
In a range of selected cells, I want to find and store the minimum date in a variable called MinDate, and the maximum date in a variable called MaxDate. How do I do that? Thanks! -- Steve C Hello Steve, You can use the Worksheet Min and Max functions on the dates. In VBA you can assign the results to your variables like this... MinDate = ActiveSheet.WorksheetFunction.Min("A1:A10") MaxDate = ActiveSheet.WorksheetFunction.Max("A1:A10") Change the range "A1:A10" to whatever you are using. To run this another Worksheet that isn't the ActiveSheet, replace ActiveSheet with... Worksheets(<Sheet Name).WorksheetFuntion.Min("A1:A10") Worksheets(<Sheet Name).WorksheetFuntion.Max("A1:A10") Sincerely, Leith Ross |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
dim MinDate as date
dim MaxDate as date mindate = application.min(selection) maxdate = application.max(selection) Steve C wrote: In a range of selected cells, I want to find and store the minimum date in a variable called MinDate, and the maximum date in a variable called MaxDate. How do I do that? Thanks! -- Steve C -- Dave Peterson |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Fabulouso! Thank you both.
-- Steve C "Dave Peterson" wrote: dim MinDate as date dim MaxDate as date mindate = application.min(selection) maxdate = application.max(selection) Steve C wrote: In a range of selected cells, I want to find and store the minimum date in a variable called MinDate, and the maximum date in a variable called MaxDate. How do I do that? Thanks! -- Steve C -- Dave Peterson |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
finding maximum, minimum in a range consists both Positive and Negative numbers | Excel Worksheet Functions | |||
Setting the minimum/maximum display range of a chart | Excel Discussion (Misc queries) | |||
Lookup Maximum between Range of Dates | Excel Discussion (Misc queries) | |||
Recording maximum and minimum | Excel Programming | |||
Automatic formatting of minimum/maximum value in a range. | Excel Discussion (Misc queries) |