Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Looking for intersection

I confused a terse email from another David about a different situation as
being from you. You can disregard.

--
Regards,
Tom Ogilvy


"David" wrote in message
...
Tom Ogilvy wrote

slight correction assuming classes is a named range:


As stated earlier, it is a dynamic named range

To eliminate the evaluate:

Sub ABCDEF()
Dim cnt as Long, rng as Range
cnt = Application.CountA(Range("Classes")) + 1
With ActiveSheet
Set rng = .Range("A1").Offset( _
Application.Match(.Range("AF3").Value, .Range("A1").Offset( _
Application.Match(.Range("AE3"), .Range("A:A"), 0) - 1, 0) _
.Resize(cnt, 1), 0) - 1 +
.Range("A1").Offset(Application.Match( _ .Range("AE3"),
.Range("A:A"), 0) - 1, 0).Row - 1, _
Application.Match(CLng(Date), .Rows(2), 0) - 1)

End With
MsgBox rng.Address
End Sub


Yup, that works, too. Any advantage (I'm trying to learn), or just
offering alternative?

Current code (modified to match sub name and MsgBox) does same and at
least to the naked eye with less overhead:

Sub ABCDEF()
Dim Rng As Range
Application.ScreenUpdating = False
sStr = "offset(A1,match(AF3,offset(" & _
"$A$1,match(AE3,A:A,0)-1,0,counta(Classes)+1,1),0)-1" & _
"+match(AE3,A:A,0)-1,Match(Today(),2:2,0)-1,1,1)"
Set Rng = Evaluate(sStr)
MsgBox Rng.Address
End Sub

--
David



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
Intersection Derick C. Charts and Charting in Excel 3 July 24th 08 11:34 AM
Intersection Excel User 123456 Excel Discussion (Misc queries) 3 June 5th 08 10:34 PM
Intersection help Ray Excel Discussion (Misc queries) 3 September 5th 07 04:15 PM
Intersection Jithu Excel Discussion (Misc queries) 5 August 2nd 07 08:12 AM
Intersection? R. Choate Excel Programming 3 December 14th 04 07:22 PM


All times are GMT +1. The time now is 04:08 PM.

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"