Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default HARD PROBLEM! Need help stat!

I am trying to find the intersection in an array based on two value
that need to be matched in the first row and column of the array.

I've written the code to find the intersection and to make the match i
the row and column, but I can't seem to combine the three pieces o
code into one functional piece.

ANY IDEAS?! PLEASE HELP. Below is what i've written so far:

'this function returns the ADDRESS of the intersection of two ranges
Function cellsincommon(a As Range, b As Range)
Dim commoncells As Range
On Error Resume Next
Set commoncells = Intersect(a, b)
If Err.Number = 0 Then cellsincommon = commoncells.Address Els
cellsincommon = 0

End Function
'this function returns the VALUE at the intersection of two ranges
Function intersectvalue(a As Range, b As Range)
Dim commoncells As Range
On Error Resume Next
Set commoncells = Intersect(a, b)
If Err.Number = 0 Then intersectvalue = commoncells.Address Els
cellsincommon = 0

End Function
'trys to find a match within a column
Function matchcol(a As Range, b As Range)
For counter = 78 To 145
Set curcell = b.Worksheet.Cells(counter, b.Column)
' If InStr(1, a.Text, curcell.Text) Then matchcol = curcell.Addres
If a.Text = curcell.Text Then matchcol = curcell.Address


Next counter
End Function

'trys to find a match within a ROW
Function matchrow(a As Range, b As Range)
For counter = 3 To 8
Set curcell = b.Worksheet.Cells(b.Row, counter)
' If InStr(1, a.Text, curcell.Text) Then matchrow = curcell.Value
If a.Text = curcell.Text Then matchrow = curcell.Address

Next counter
End Functio

--
Message posted from http://www.ExcelForum.com

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
Little Problem, Difficult and Hard. MFS Excel Discussion (Misc queries) 1 August 8th 09 09:54 PM
SW STAT+ jd.farm Excel Worksheet Functions 1 October 15th 07 11:27 PM
Column matching - sorting. Fairly hard problem, I think. A S-D Excel Discussion (Misc queries) 13 April 7th 06 01:52 PM
Baseball Stat Problem [email protected] Excel Discussion (Misc queries) 6 March 27th 06 01:19 PM
Begineer with (seemingly) hard problem mrayner Excel Discussion (Misc queries) 7 June 28th 05 08:20 AM


All times are GMT +1. The time now is 02:25 PM.

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"