LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #26   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 394
Default How to find the most common pair and triplet numbers?

Hi Vergel Adriano,

Out of interest was do the variables i & j actually do please.

'FindTriplets
lRow = 2
For Each c In rng
If c.Column <= 5 Then
For i = 1 To 6 - c.Column
For j = 1 To 6 - c.Offset(0, i).Column
strTriplet = c.Value & "_" & c.Offset(0, i).Value &
"_" & c.Offset(0, i + j).Value

On Error Resume Next
lRow2 =
Application.WorksheetFunction.Match(strTriplet, wsResult.Range("E:E"), False)
If Err.Number 0 Then
wsResult.Range("E" & lRow).Value = strTriplet
wsResult.Range("F" & lRow).Value = c.Value
wsResult.Range("G" & lRow).Value = c.Offset(0,
i).Value
wsResult.Range("H" & lRow).Value = c.Offset(0, i
+ j).Value
wsResult.Range("I" & lRow).Value = 1
lRow = lRow + 1
Else
wsResult.Range("I" & lRow2).Value =
wsResult.Range("I" & lRow2).Value + 1
End If
On Error GoTo 0
Next j
Next i
End If
Next c
End If


Thanks in Advance.
All the Best.
Paul

 
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
How to find the most common numbers? alikirca20 New Users to Excel 2 April 12th 09 12:09 AM
From 2 rows or column how to find common numbers A S Matharu Excel Discussion (Misc queries) 1 March 13th 09 12:39 AM
count and return pair numbers Sly Excel Worksheet Functions 14 July 28th 07 04:51 PM
Need code to pair off numbers davidm Excel Programming 0 February 16th 06 04:21 AM
in excel, how do I find which value doesn't have a pair? curiousjackie Excel Discussion (Misc queries) 3 December 17th 04 05:43 PM


All times are GMT +1. The time now is 09:49 AM.

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"