View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
joel joel is offline
external usenet poster
 
Posts: 9,101
Default Best way to find repeated matches?

The are two methods for converting worksheet formulas to VBA code.

Method 1 - If VBA has an equivalent function then change the code to VBA
function. A simple case of this is the IF function.

for worksheet
=if(condition,true,false)

for VBA
if condition then
true statements
else
false statenments
end if

Method 2 - use worksheet function in VBA
worksheet
=countif(A1:C5,"=5")

VBA
total = worksheetfunction.countif(Range("A1:C5"),"=5")


Sometimes you need to use a combination of Method 1 and Method 2
If you post your formul I can do the conversion if you have any problems.

"Keith R" wrote:

I came up with a worksheet formula that does what I need, which I was then
going to bring over to VBA to find matching rows and grab some additional
data: