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
|