Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8
Default Calendar range and date intersect

How do I fill with a specific value the returned active cell from the
intersect of a calendar dates range in Row 1 (Col B thru ...) and any
date from a Target dates list in Col. A ?
Thank you for help.
Celeste

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calendar range and date intersect

Your question is not very clear, but perhaps something here.

Dim res as Variant, res2 as Variant
Dim dt as Date
dt = "some date"
res = Application.Match(clng(date),rows(1),0)
res2 = Application.Match(dt,Columns(1),0)
if not iserror(res) and not iserror(res2) then
cells(res2,res).Value = "Intersect"
else
msgbox "At least one date not found"
End if

--
Regards,
Tom Ogilvy




wrote in message
oups.com...
How do I fill with a specific value the returned active cell from the
intersect of a calendar dates range in Row 1 (Col B thru ...) and any
date from a Target dates list in Col. A ?
Thank you for help.
Celeste



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Calendar range and date intersect

Sub ABC()
Dim cell as Range, res as variant
for each cell in Range(Range("A2"),Range("A2").End(xldown))
res = application.Match(clng(cell),rows(1),0)
if not iserror(res) then
cells(cell.row,res).Value = cell.offset(0,1).Value
end if
Next
End Sub

this assumes the entries like 8/14 are actually stored as dates like
8/14/2006 in both row and column and formatted to show as m/dd

--
Regards,
Tom Ogilvy


"Tom Ogilvy" wrote in message
...
Your question is not very clear, but perhaps something here.

Dim res as Variant, res2 as Variant
Dim dt as Date
dt = "some date"
res = Application.Match(clng(date),rows(1),0)
res2 = Application.Match(dt,Columns(1),0)
if not iserror(res) and not iserror(res2) then
cells(res2,res).Value = "Intersect"
else
msgbox "At least one date not found"
End if

--
Regards,
Tom Ogilvy




wrote in message
oups.com...
How do I fill with a specific value the returned active cell from the
intersect of a calendar dates range in Row 1 (Col B thru ...) and any
date from a Target dates list in Col. A ?
Thank you for help.
Celeste





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
intersect named range in different workbook Jason[_9_] Excel Discussion (Misc queries) 2 October 17th 07 09:43 PM
Combine Intersect Range in If statements Ben Dummar Excel Discussion (Misc queries) 5 March 22nd 07 10:37 PM
Intersect check range DoctorG Excel Programming 2 March 17th 06 07:33 PM
Is it possible to ensure Calendar date is in range Robert Hargreaves Excel Programming 1 May 27th 05 08:38 PM
Is there a "Non-Intersect" VBA method to remove a sub-range from a range? brettdj Excel Programming 1 December 11th 03 06:13 AM


All times are GMT +1. The time now is 02:09 AM.

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

About Us

"It's about Microsoft Excel"