View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 195
Default VBA to scan range

David wrote

Bob Phillips wrote

MsgBox Evaluate("=MAX(IF(WEEKDAY(C2:AA2)=6,C2:AA2))")


I don't know what I was thinking. There's really no need to scan all
the dates. Since V2 (4th Friday) will always hold a date, and AA2 (5th
Friday) may or may not, I only need to look at those 2 cells:

LastFri = Application.Max([C2], [AA2])


All brackets not needed:
LastFri = Application.Max([V2, AA2])
or standard convention:
LastFri = Application.Max(Range("V2, AA2"))

--
David