Not tested. You might want to convert iModule2 to a long.
'Troubleshooting: Use in situation where XL crashes
MsgBox ("String to Compare is " & _
str1 = wsST.Cells(lRowST, 1) & wsST.Cells(lRowST, 2) & wsST.Cells(lRowST, 3) _
& Chr(13) & "Str2 Column is " & getColLtr(iModule2))
For lRowAF = 2 To wsST.Range(getColLtr(iModule2) & wsST.Rows).End(xlUp).Row
str1 = wsST.Cells(lRowST, 1) & wsST.Cells(lRowST, 2) & wsST.Cells(lRowST, 3)
str2 = wsST.Cells(lRowAF, iModule2) & wsST.Cells(lRowAF, iModule2 + 1) & wsST.Cells(lRowAF, iModule2 + 2)
'Troubleshooting, replace 1000 with 500 or as needed
If (lRowAF Mod 1000 = 0) Then
MsgBox ("AF Row is " & lRowAF _
& Chr(13) & "ST Row is " & lRowST)
ShowProcesses 'Make sure you have a "Sheet3" in the Workbook
End If
If str1 <> str2 Then 'str1 and str2 are not the same
bMatchFound = True
ExitLoop
End If
Next lRowAF
Sub ShowProcesses()
'Written: July 06, 2011
'Author: Leith Ross
Dim arrData As Variant
Dim arrLabels As Variant
Dim N As Long
Dim Rng As Range
Dim RowCnt As Long
Dim sngProcessTime As Single
Dim Wks As Worksheet
'Worksheet and starting cell of Process List
Set Wks = Worksheets("Sheet3")
Set Rng = Wks.Range("A1")
'Local computer
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\cimv2")
Set colProcesses = objWMIService.ExecQuery _
("Select * from Win32_Process")
arrLabels = Array("Process:", "Processor Time:", "Process ID:", _
"Working Set Size:", "Page File Size:", "Page Faults:")
RowCnt = UBound(arrLabels) + 1
For Each objProcess In colProcesses
sngProcessTime = (CSng(objProcess.KernelModeTime) + _
CSng(objProcess.UserModeTime)) / 10000000
With objProcess
arrData = Array(.Name, sngProcessTime, .ProcessId, _
.Workingsetsize, .PageFileUsage, .PageFaults)
End With
With Rng.Resize(RowCnt, 1)
.Offset(N, 0) = WorksheetFunction.Transpose(arrLabels)
.Offset(N, 1) = WorksheetFunction.Transpose(arrData)
End With
N = N + UBound(arrData) + 2
Next objProcess
End Sub