Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Little Problem, Difficult and Hard. | Excel Discussion (Misc queries) | |||
SW STAT+ | Excel Worksheet Functions | |||
Column matching - sorting. Fairly hard problem, I think. | Excel Discussion (Misc queries) | |||
Baseball Stat Problem | Excel Discussion (Misc queries) | |||
Begineer with (seemingly) hard problem | Excel Discussion (Misc queries) |