Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default vba question.. matching in columns

I am trying to take a cell and find the match within a row, then tak
another cell and find a match within a column and finally take th
intersection of that row and column where the matches were found.
can find the intersection of two ranges, the match in a given column
but I cant get the row version (see below) to work, nor am i sure ho
to tie these three functions together. Any ideas? Thx

Can anyone help me accomplish this?
I've got this far:
'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 88
Set curcell = b.Worksheet.Cells(counter, b.Column)
If InStr(1, 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 6
Set curcell = b.Worksheet.Cells(b.Row, counter)
If InStr(1, 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
Matching 2 columns Lynda Excel Worksheet Functions 3 August 26th 09 09:44 AM
matching on columns nick Excel Discussion (Misc queries) 0 October 24th 06 05:02 PM
Matching a Date question ben simpson New Users to Excel 1 March 9th 06 09:12 AM
Matching Question carl Excel Worksheet Functions 0 December 9th 05 08:35 PM
Matching Question carl Excel Worksheet Functions 3 March 1st 05 10:55 PM


All times are GMT +1. The time now is 06:38 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"