Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 73
Default Name a Range based on Dates

Hello All,

I have dates starting from 01-03-2006 and till today

The dates keeps on adding but the same date is not repeated. Or say
even f it is repeated it is sorted according to date.

No how i can dynamically name the range based on month? for eg
01-03-2006 to 31-03-2006 named as RngMarch and 01-04-06 to 30-04-06 as
RngApr and so on..

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Name a Range based on Dates

Dim iStart As Long
Dim iend As Long
Dim rng As Range

iStart =
ActiveSheet.Evaluate("=MIN(IF(MONTH(A1:A1000)=3,RO W(A1:A1000)))")
iend = ActiveSheet.Evaluate("=MAX(IF(MONTH(A1:A1000)=3,RO W(A1:A1000)))")
Set rng = Range("A" & iStart & ":A" & iend)
rng.Name = "rngMarch"


--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)

"Soniya" wrote in message
oups.com...
Hello All,

I have dates starting from 01-03-2006 and till today

The dates keeps on adding but the same date is not repeated. Or say
even f it is repeated it is sorted according to date.

No how i can dynamically name the range based on month? for eg
01-03-2006 to 31-03-2006 named as RngMarch and 01-04-06 to 30-04-06 as
RngApr and so on..

Thanks



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
sum values based on range of dates mattvcommuter Excel Discussion (Misc queries) 1 January 19th 11 09:37 AM
sum of info in a range based on dates Real esate guru Excel Worksheet Functions 4 September 15th 08 10:28 PM
Summing based on a range of dates Dale Excel Discussion (Misc queries) 3 June 30th 08 09:49 PM
Lookup based on range of dates dls2193 Excel Worksheet Functions 1 March 30th 06 11:21 PM
return based on range of dates Matt Excel Worksheet Functions 6 February 15th 06 08:36 PM


All times are GMT +1. The time now is 04:53 AM.

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"