Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Date Range displayed in header

I am attempting to put the range of MIN and MAX dates pulled from a column. I
would like it to look like:

Date Range: 9/6/2006 - 10/26/2006

from a column like this:

Date
09/06/2006
09/06/2006
09/10/2006
10/12/2006
10/26/2006

Thanks in advance
BD
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 2,574
Default Date Range displayed in header

=CONCATENATE("Date Range": ",MIN([range])," - ",MAX([range]))

Note the space after the colon and before and after the hyphen,
elseeverythingwillgetsquashedtogetherlikethis.

Dave
--
Brevity is the soul of wit.


"Bdadmin" wrote:

I am attempting to put the range of MIN and MAX dates pulled from a column. I
would like it to look like:

Date Range: 9/6/2006 - 10/26/2006

from a column like this:

Date
09/06/2006
09/06/2006
09/10/2006
10/12/2006
10/26/2006

Thanks in advance
BD

  #3   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Date Range displayed in header

=text(min(a1:a10),"m/d/yyyy") & " - " & text(max(a1:a10),"m/d/yyyy")

Bdadmin wrote:

I am attempting to put the range of MIN and MAX dates pulled from a column. I
would like it to look like:

Date Range: 9/6/2006 - 10/26/2006

from a column like this:

Date
09/06/2006
09/06/2006
09/10/2006
10/12/2006
10/26/2006

Thanks in advance
BD


--

Dave Peterson
  #4   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Date Range displayed in header

Thanks for the quick reply.
I couldn't get it to work as typed, error. However, if I modify it will at
least not give error, but formatting isn't correct. It only works in the
worksheet though, if in header only shows as text.

I modified like this:
=CONCATENATE("Date Range: " & MIN(A:A)," - " & MAX(A:A))
and get this:
Date Range: 38995.7438773148 - 39007.7204976852

Cell is set to date mm/dd/yy


"Dave F" wrote:

=CONCATENATE("Date Range": ",MIN([range])," - ",MAX([range]))

Note the space after the colon and before and after the hyphen,
elseeverythingwillgetsquashedtogetherlikethis.

Dave
--
Brevity is the soul of wit.


"Bdadmin" wrote:

I am attempting to put the range of MIN and MAX dates pulled from a column. I
would like it to look like:

Date Range: 9/6/2006 - 10/26/2006

from a column like this:

Date
09/06/2006
09/06/2006
09/10/2006
10/12/2006
10/26/2006

Thanks in advance
BD

  #5   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Date Range displayed in header

Thanks for the reply. That works great in a cell on the worksheet, but how do
I get it to display in the header?

Thanks in advance.
BD

"Dave Peterson" wrote:

=text(min(a1:a10),"m/d/yyyy") & " - " & text(max(a1:a10),"m/d/yyyy")

Bdadmin wrote:

I am attempting to put the range of MIN and MAX dates pulled from a column. I
would like it to look like:

Date Range: 9/6/2006 - 10/26/2006

from a column like this:

Date
09/06/2006
09/06/2006
09/10/2006
10/12/2006
10/26/2006

Thanks in advance
BD


--

Dave Peterson



  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 35,218
Default Date Range displayed in header

A header like a print header?

You have to do it manually or use a macro.

Rightclick on the Excel icon to the left of the File dropdown on the worksheet
menu bar.
Select view code and paste this into the code window:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim myMin As Date
Dim myMax As Date
Dim myStr As String
Dim myRng As Range

With Worksheets("sheet9999")
Set myRng = .Range("a:a")
myMin = Application.Min(myRng)
myMax = Application.Max(myRng)
myStr = "Date Range: " & Format(myMin, "mm/dd/yyyy") _
& " - " & Format(myMax, "mm/dd/yyyy")
.PageSetup.LeftHeader = myStr
End With
End Sub

Change sheet9999 to the correct name.



Bdadmin wrote:

Thanks for the reply. That works great in a cell on the worksheet, but how do
I get it to display in the header?

Thanks in advance.
BD

"Dave Peterson" wrote:

=text(min(a1:a10),"m/d/yyyy") & " - " & text(max(a1:a10),"m/d/yyyy")

Bdadmin wrote:

I am attempting to put the range of MIN and MAX dates pulled from a column. I
would like it to look like:

Date Range: 9/6/2006 - 10/26/2006

from a column like this:

Date
09/06/2006
09/06/2006
09/10/2006
10/12/2006
10/26/2006

Thanks in advance
BD


--

Dave Peterson


--

Dave Peterson
  #7   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 4
Default Date Range displayed in header

That worked great. Thanks for the help

BD

"Dave Peterson" wrote:

A header like a print header?

You have to do it manually or use a macro.

Rightclick on the Excel icon to the left of the File dropdown on the worksheet
menu bar.
Select view code and paste this into the code window:

Option Explicit
Private Sub Workbook_BeforePrint(Cancel As Boolean)
Dim myMin As Date
Dim myMax As Date
Dim myStr As String
Dim myRng As Range

With Worksheets("sheet9999")
Set myRng = .Range("a:a")
myMin = Application.Min(myRng)
myMax = Application.Max(myRng)
myStr = "Date Range: " & Format(myMin, "mm/dd/yyyy") _
& " - " & Format(myMax, "mm/dd/yyyy")
.PageSetup.LeftHeader = myStr
End With
End Sub

Change sheet9999 to the correct name.



Bdadmin wrote:

Thanks for the reply. That works great in a cell on the worksheet, but how do
I get it to display in the header?

Thanks in advance.
BD

"Dave Peterson" wrote:

=text(min(a1:a10),"m/d/yyyy") & " - " & text(max(a1:a10),"m/d/yyyy")

Bdadmin wrote:

I am attempting to put the range of MIN and MAX dates pulled from a column. I
would like it to look like:

Date Range: 9/6/2006 - 10/26/2006

from a column like this:

Date
09/06/2006
09/06/2006
09/10/2006
10/12/2006
10/26/2006

Thanks in advance
BD

--

Dave Peterson


--

Dave Peterson

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Return info based on Date Range kermitforney Excel Worksheet Functions 3 July 11th 06 07:59 PM
Conditional formatting based on date range RGB Excel Discussion (Misc queries) 3 May 23rd 06 05:37 PM
summing a date range david72 Excel Discussion (Misc queries) 1 May 18th 06 01:14 PM
how to check if date falls within range Bharat Saboo Excel Worksheet Functions 4 December 30th 05 10:31 AM
adding occurrences for date range Mike Excel Discussion (Misc queries) 1 April 28th 05 09:14 PM


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

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"