Please Help!

  • Thread starter Thread starter Lacy
  • Start date Start date
L

Lacy

Thanks for the help. I made the changes. Now I'm getting
Type Mismatch. Got any ideas? Thanks again, Lacy

Do
Count = 1
Total = Count
For i = ActiveWorkbook.Worksheets("Sheet1").Cells(3, 10)
To ActiveWorkbook.Worksheets("Sheet1").Cells(Rows.Count,
10).End(xlUp).Row
For j = ActiveWorkbook.Worksheets("Sheet1").Cells(3, 11)
To ActiveWorkbook.Worksheets("Sheet1").Cells(Rows.Count,
11).End(xlUp).Row
For k = ActiveWorkbook.Worksheets("Sheet1").Cells(3,
34) To ActiveWorkbook.Worksheets("Sheet1").Cells
(Rows.Count, 34).End(xlUp).Row
If i = i + 1 Then
If j = j + 1 Then
If k = k + 1 Then
Count = Count + 1
End If
End If
End If
For l = ActiveWorkbook.Worksheets("Sheet1").Cells(3,
10) To ActiveWorkbook.Worksheets("Sheet1").Cells
(Rows.Count, 10).End(xlUp).Row
Total = Total + Count
Next l
Next k
Next j
Next i
Loop While ActiveWorkbook.Worksheets("Sheet1").Cells
(Rows.Count, 10).End(xlUp).Row.Value <> ""
 
Lacy,

What line of code is giving you the Type Mismatch error? Also,
note that your lines like

If i = i + 1 Then

will always return False. Perhaps you are thinking of this sort
of syntax in C, but VBA operates differently.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com
 
Thanks. I don't know what line is giving me the type
mismatch for some reason the debugger is not highlighting
the problem. Also, I change my for loops, does this look
better? Thanks again, Lacy.

RowCount = ActiveWorkbook.Worksheets("Sheet1").Cells
(Rows.Count, 10).End(xlUp).Row

Do
Count = 1
Total = Count
For i = 3 To RowCount
For j = 3 To RowCount
For k = 3 To RowCount
If ActiveWorkbook.Worksheets("Sheet1").Cells(i, 10)
= ActiveWorkbook.Worksheets("Sheet1").Cells(i + 1, 10) Then
If ActiveWorkbook.Worksheets("Sheet1").Cells(i,
11) = ActiveWorkbook.Worksheets("Sheet1").Cells(i + 1, 11)
Then
If ActiveWorkbook.Worksheets("Sheet1").Cells(i,
34) = ActiveWorkbook.Worksheets("Sheet1").Cells(i + 1, 34)
Then
Count = Count + 1
End If
End If
End If
For l = ActiveWorkbook.Worksheets("Sheet1").Cells(3,
10) To ActiveWorkbook.Worksheets("Sheet1").Cells
(Rows.Count, 10).End(xlUp).Row
Total = Total + Count
Next l
Next k
Next j
Next i
Loop While ActiveWorkbook.Worksheets("Sheet1").Cells
(Rows.Count, 10).End(xlUp).Row.Value <> ""
 
Back
Top