問題:特定のポリシー番号を探すために大きなシートを検索する必要があります。75,000行近くある場合、検索機能にはかなりの時間がかかります。これらの75,000行の2枚のシートを比較する方法について何か提案はありますか?私がうまくいくと思った解決策は、各シートを並べ替えてから、見つける必要のあるポリシー番号を取得して、それを中央の行と比較することです。そのポリシー番号を比較して、単純な並べ替え関数でそれが大きいか小さいかを確認する方法はありますか?その比較を見つけた後、私は上限と下限をリセットし、再び中間を見つけます。...これはもっと速いでしょうか?他に何か提案はありますか?
ありがとうございました
現在のコード:
Sub policyComment()
Dim x As Integer
Dim endRow As Variant
Dim polSer As String
Dim foundVal As String
Dim commentVar As Variant
Windows("SuspenseNoteMacro.xlsm").Activate
Sheets("Main").Select
Range("A2").Select
endRow = ActiveCell.End(xlDown)
x = 2
Do
polSer = Range("A" + CStr(x)).Value
Windows("010713 Suspense ALL.xlsm").Activate
Sheets("Sheet1").Select
Set foundRange = Sheets("Sheet1").Cells.Find(what:=polSer, LookIn:=xlFormulas, lookat:=xlWhole)
'foundRange = ActiveCell.Value
If foundRange Is Nothing Then
Windows("SuspenseNoteMacro.xlsm").Activate
Sheets("Main").Select
Range("J" + CStr(x)).Value = "Not Found"
ElseIf foundRange <> "" Then
Sheets("Sheet1").Cells.Find(what:=polSer, LookIn:=xlFormulas, lookat:=xlWhole).Activate
commentVar = Range("J" + CStr(ActiveCell.Row)).Value
Windows("SuspenseNoteMacro.xlsm").Activate
Sheets("Main").Select
Range("J" + CStr(x)).Value = commentVar
End If
x = x + 1
Range("A" + CStr(x)).Select
foundRange = ""
Loop Until (x = endRow)
End Sub