Click here to Skip to main content
15,925,723 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: Manually disposing objects with API Pin
Name Removed27-Jun-04 15:36
Name Removed27-Jun-04 15:36 
GeneralRe: Manually disposing objects with API Pin
Dave Kreskowiak27-Jun-04 18:18
mveDave Kreskowiak27-Jun-04 18:18 
GeneralConverting C# code to VB.NET code... Pin
milkmood27-Jun-04 12:54
milkmood27-Jun-04 12:54 
GeneralRe: Converting C# code to VB.NET code... Pin
milkmood27-Jun-04 13:26
milkmood27-Jun-04 13:26 
GeneralRe: Converting C# code to VB.NET code... Pin
Christian Graus27-Jun-04 13:35
protectorChristian Graus27-Jun-04 13:35 
Generalmouse action Pin
ahmad_yossef27-Jun-04 10:57
ahmad_yossef27-Jun-04 10:57 
GeneralRe: mouse action Pin
Dave Kreskowiak28-Jun-04 2:57
mveDave Kreskowiak28-Jun-04 2:57 
GeneralComparison in Excel Pin
jbreen727-Jun-04 10:11
jbreen727-Jun-04 10:11 
Hello All,

I need to compare cells in excel to determine if a combination of three numbers appears within another combination of five numbers (each number is in its seperate cell). I think the code that I have written is partially working, however I am having a problem storing the values of my counter.
For example lets say that these are my 5 number combos:
1 2 3 4 5
1 3 5 7 8
And these are my 3 number combos
1 2 3
2 4 5
1 3 5

Based on the above, 1 2 3 appears once, 2 4 5 appears once and 1 3 5 appears twice. In reality I will be comparing a large number of 3 number combinations compared to the 5 number combos. So far this is the code that I have. j is the row for 3 combos and r is the row for the 5 combos. f is the final value that I will get from my flags:

For j = 2 To 60
Set curCell_7 = Worksheets("Combinations").Cells(j, 9)
Set curCell_8 = Worksheets("Combinations").Cells(j, 10)
Set curCell_9 = Worksheets("Combinations").Cells(j, 11)
For r = 2 To 15
Set curCell_2 = Worksheets("Combinations").Cells(r, 2)
Set curCell_3 = Worksheets("Combinations").Cells(r, 3)
Set curCell_4 = Worksheets("Combinations").Cells(r, 4)
Set curCell_5 = Worksheets("Combinations").Cells(r, 5)
Set curCell_6 = Worksheets("Combinations").Cells(r, 6)
If curCell_7.Value = curCell_2.Value Then
a = 1
ElseIf curCell_7.Value = curCell_3.Value Then
b = 1
ElseIf curCell_7.Value = curCell_4.Value Then
c = 1
ElseIf curCell_7.Value = curCell_5.Value Then
d = 1
ElseIf curCell_7.Value = curCell_6.Value Then
e = 1
End If
' If f equals to 1 then store f to final sum
f = (a + b + c + d + e) / 3
Worksheets("Combinations").Cells(j, 12) = f
Next r
Next j

The problem I am having is storing the value of f. I am sure that this is a simple one but I do not typically code in VB so I am a little unsure of how to store this value and could not determine it from what I read on the internet. Can anyone help me with this? Thanks.

John Breen
GeneralRe: Comparison in Excel Pin
Dave Kreskowiak28-Jun-04 3:01
mveDave Kreskowiak28-Jun-04 3:01 
Generaldisbale any pop up menu Pin
?!?27-Jun-04 6:38
?!?27-Jun-04 6:38 
GeneralRe: disbale any pop up menu Pin
Dave Kreskowiak27-Jun-04 14:25
mveDave Kreskowiak27-Jun-04 14:25 
GeneralNeed Hekp Please... Pin
hani_aql27-Jun-04 5:26
hani_aql27-Jun-04 5:26 
GeneralRe: Need Hekp Please... Pin
Dave Kreskowiak27-Jun-04 14:33
mveDave Kreskowiak27-Jun-04 14:33 
GeneralProblem with Classes in VB6 Pin
BernardBouree27-Jun-04 1:00
BernardBouree27-Jun-04 1:00 
GeneralRe: Problem with Classes in VB6 Pin
Steven Campbell27-Jun-04 9:14
Steven Campbell27-Jun-04 9:14 
QuestionHow to delete Temp Files and IE history? Pin
Lucktas26-Jun-04 22:54
Lucktas26-Jun-04 22:54 
AnswerRe: How to delete Temp Files and IE history? Pin
A_Yakout27-Jun-04 0:53
A_Yakout27-Jun-04 0:53 
GeneralRe: How to delete Temp Files and IE history? Pin
Lucktas27-Jun-04 2:52
Lucktas27-Jun-04 2:52 
GeneralRe: How to delete Temp Files and IE history? Pin
A_Yakout27-Jun-04 19:18
A_Yakout27-Jun-04 19:18 
AnswerRe: How to delete Temp Files and IE history? Pin
Aaron Eldreth28-Jun-04 3:45
Aaron Eldreth28-Jun-04 3:45 
GeneralRe: How to delete Temp Files and IE history? Pin
Lucktas28-Jun-04 7:19
Lucktas28-Jun-04 7:19 
GeneralRe: How to delete Temp Files and IE history? Pin
Dave Kreskowiak28-Jun-04 9:48
mveDave Kreskowiak28-Jun-04 9:48 
GeneralRe: How to delete Temp Files and IE history? Pin
Dave Kreskowiak28-Jun-04 15:37
mveDave Kreskowiak28-Jun-04 15:37 
GeneralRe: How to delete Temp Files and IE history? Pin
Aaron Eldreth29-Jun-04 2:25
Aaron Eldreth29-Jun-04 2:25 
GeneralRe: How to delete Temp Files and IE history? Pin
Lucktas29-Jun-04 6:17
Lucktas29-Jun-04 6:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.